474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
|
TEST(@"-[deleteTrailingWhitespaces]",
(s[0] = [OFMutableString stringWithString: whitespace[0]]) &&
R([s[0] deleteTrailingWhitespaces]) &&
[s[0] isEqual: @" \r \t\n\t \tasd"] &&
(s[0] = [OFMutableString stringWithString: whitespace[1]]) &&
R([s[0] deleteTrailingWhitespaces]) && [s[0] isEqual: @""])
TEST(@"-[deleteLeadingAndTrailingWhitespaces]",
(s[0] = [OFMutableString stringWithString: whitespace[0]]) &&
R([s[0] deleteLeadingAndTrailingWhitespaces]) &&
[s[0] isEqual: @"asd"] &&
(s[0] = [OFMutableString stringWithString: whitespace[1]]) &&
R([s[0] deleteLeadingAndTrailingWhitespaces]) &&
[s[0] isEqual: @""])
TEST(@"-[stringByXMLEscaping]",
(s[0] = (id)[@"<hello> &world'\"!&" stringByXMLEscaping]) &&
[s[0] isEqual: @"<hello> &world'"!&"])
TEST(@"-[stringByXMLUnescaping]",
[[s[0] stringByXMLUnescaping] isEqual: @"<hello> &world'\"!&"] &&
|
|
<
|
|
<
|
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
|
TEST(@"-[deleteTrailingWhitespaces]",
(s[0] = [OFMutableString stringWithString: whitespace[0]]) &&
R([s[0] deleteTrailingWhitespaces]) &&
[s[0] isEqual: @" \r \t\n\t \tasd"] &&
(s[0] = [OFMutableString stringWithString: whitespace[1]]) &&
R([s[0] deleteTrailingWhitespaces]) && [s[0] isEqual: @""])
TEST(@"-[deleteEnclosingWhitespaces]",
(s[0] = [OFMutableString stringWithString: whitespace[0]]) &&
R([s[0] deleteEnclosingWhitespaces]) && [s[0] isEqual: @"asd"] &&
(s[0] = [OFMutableString stringWithString: whitespace[1]]) &&
R([s[0] deleteEnclosingWhitespaces]) && [s[0] isEqual: @""])
TEST(@"-[stringByXMLEscaping]",
(s[0] = (id)[@"<hello> &world'\"!&" stringByXMLEscaping]) &&
[s[0] isEqual: @"<hello> &world'"!&"])
TEST(@"-[stringByXMLUnescaping]",
[[s[0] stringByXMLUnescaping] isEqual: @"<hello> &world'\"!&"] &&
|