Allow CRLF and LF in NSXMLParser test

This commit is contained in:
Hugo Melder 2022-08-23 19:18:44 +02:00 committed by GitHub
parent 32eb5d2acd
commit 78d9f73a36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -240,7 +240,9 @@ static BOOL setShouldResolveExternalEntities = NO;
static BOOL
testParser(NSXMLParser *parser, NSString *expect)
{
Handler *handler;
NSString *convertWin;
NSString *desc;
Handler *handler;
[parser setShouldProcessNamespaces: setShouldProcessNamespaces];
[parser setShouldReportNamespacePrefixes: setShouldReportNamespacePrefixes];
@ -257,13 +259,12 @@ testParser(NSXMLParser *parser, NSString *expect)
}
else
{
#if defined(_WIN32)
/* Replace CRLF from result files with LF
*/
expect = [expect stringByReplacingOccurrencesOfString: @"\r\n" withString: @"\n"];
#endif
convertWin = [expect stringByReplacingOccurrencesOfString: @"\r\n" withString: @"\n"];
desc = [handler description];
if (NO == [[handler description] isEqual: expect])
if (NO == [desc isEqual: expect] && NO == [desc isEqual: convertWin])
{
NSLog(@"######## Expected:\n%@\n######## Parsed:\n%@\n########\n",
expect, [handler description]);