directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny" <elecha...@gmail.com>
Subject Re: openldap.g schema parser prefixes double quotes with a backslash
Date Sun, 01 Jun 2008 09:25:13 GMT
On Sun, Jun 1, 2008 at 11:11 AM, Stefan Seelmann <seelmann@apache.org> wrote:
> Hi,
>
> In testAttributeTypeParseWithDescQuotes() of OpenLdapSchemaParserTest
> (http://tinyurl.com/58nhpm) the DESC element contains two double quotes:
>
>  ... DESC 'RFC2256: \"knowledge\" information'\n" ...
>
> The parser in openldap.g adds a backslash before each double quote and
> this is also expected in the test:
>
>  assertEquals( "RFC2256: \\\"knowledge\\\" information",
> type.getDescription() );
>
> I just wonder what's the reason for adding a backslash?

Because otherwise, the two strings wont be equal :)

The first \\ in the assert will be transformed into a \ internally.
The following \" is transformed to a "
This result to a \" internally, to be compared with the original DESC,
containing \".



-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com

Mime
View raw message