Hi guys,

I'm reviewing the DN Parser, as I think we are overdoing. So far, I have
something that works, except a couple of tests that fail. One otf them is :

    public void testRdnWithEscapedComa() throws LdapException
    {
        ...
        Rdn rdn = new Rdn( "a=\"b\\,c\"" );
        assertEquals( "a=\"b\\,c\"", rdn.getName() );
        assertEquals( "a=b\\,c", rdn.getNormName() );   // WRONG !!!

Here, I think the test is wrong. The initial value is surrounded by
quotes, which means that we don't need to escape special chars like ','
into it. Actually, the following value is accepted :

    Rdn rdn1 = new Rdn( "a=b\\,c" );

and the RDN value is 'b,c' (the ',' is escaped to avoid a confusion with
the next RDN in a DN)

but when we use quotes, this is equivalent to :

    Rdn rdn2 = new Rdn( "a=\"b,c\"" );

Here rdn1 <==> rdn2 (or it should be equivalent.

On the other hand, this rdn :

    Rdn rdn3 = new Rdn( "a=\"b\\,c\"" );

should be equivalent to :

    Rdn rdn4 = new Rdn( "a=b\\\,c" );

where we must keep an escaped escape and an escaped coma.

Thoughts ?

Reply via email to