You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jk...@apache.org on 2024/01/16 03:56:43 UTC
(xalan-test) branch XALANJ-2419 updated: Some of the tests were apparently using the wrong reference strings, execting literal unicode character where we should be outputting entity reference. I think.
This is an automated email from the ASF dual-hosted git repository.
jkesselm pushed a commit to branch XALANJ-2419
in repository https://gitbox.apache.org/repos/asf/xalan-test.git
The following commit(s) were added to refs/heads/XALANJ-2419 by this push:
new 7044833e Some of the tests were apparently using the wrong reference strings, execting literal unicode character where we should be outputting entity reference. I think.
7044833e is described below
commit 7044833e4c7a88da7e38061db545e8477bae86a4
Author: kubycsolutions <ke...@kubyc.solutions>
AuthorDate: Mon Jan 15 22:56:36 2024 -0500
Some of the tests were apparently using the wrong reference strings, execting literal unicode character where we should be outputting entity reference. I think.
---
.../org/apache/qetest/trax/ToXMLStreamTest.java | 48 +++++++++++++---------
1 file changed, 28 insertions(+), 20 deletions(-)
diff --git a/java/src/org/apache/qetest/trax/ToXMLStreamTest.java b/java/src/org/apache/qetest/trax/ToXMLStreamTest.java
index 65a85f13..e6f3d5cb 100644
--- a/java/src/org/apache/qetest/trax/ToXMLStreamTest.java
+++ b/java/src/org/apache/qetest/trax/ToXMLStreamTest.java
@@ -70,13 +70,14 @@ public class ToXMLStreamTest extends ToStreamTest
String actual1a = outputAttrValue(makeStream("UTF-8"), "abc");
reporter.check(actual1a, "abc", "Simple characters should come out unscathed (as attribute value)");
- String AELIG_OSLASH_ARING = "\u00e6\u00f8\u00e5"; // \
+ String AELIG_OSLASH_ARING = "\u00e6\u00f8\u00e5";
+ String NCR_AELIG_OSLASH_ARING = "æøå";
String actual2 = outputCharacters(makeStream("UTF-8"), AELIG_OSLASH_ARING);
reporter.check(actual2, AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out unscathed");
String actual2a = outputAttrValue(makeStream("UTF-8"), AELIG_OSLASH_ARING);
reporter.check(actual2a, AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out unscathed (as attribute value)");
- String CHINESE = "\u95c9\u6d77\u4e95"; // \
+ String CHINESE = "\u95c9\u6d77\u4e95";
String actual3 = outputCharacters(makeStream("UTF-8"), CHINESE);
reporter.check(actual3, CHINESE, "BMP characters should come out unscathed");
String actual3a = outputAttrValue(makeStream("UTF-8"), CHINESE);
@@ -86,9 +87,9 @@ public class ToXMLStreamTest extends ToStreamTest
reporter.check(utf16String.length(), 5, "String with two astral characters and one in the BMP should have length of 5 UTF-16 code units");
String actual4 = outputCharacters(makeStream("UTF-8"), utf16String);
- reporter.check(actual4, utf16String, "Astral characters should come out unscathed");
+ reporter.check(actual4, utf16String, "Astral characters should come out unscathed: got '"+actual4+"', expected '"+utf16String+"'");
String actual4a = outputAttrValue(makeStream("UTF-8"), utf16String);
- reporter.check(actual4a, utf16String, "Astral characters should come out unscathed (as attribute value)");
+ reporter.check(actual4a, utf16String, "Astral characters should come out unscathed (as attribute value): got '"+actual4+"', expected '"+utf16String+"'");
reporter.testCaseClose();
return true;
@@ -109,25 +110,32 @@ public class ToXMLStreamTest extends ToStreamTest
String actual1a = outputAttrValue(makeStream("ISO-8859-1"), "abc");
reporter.check(actual1a, "abc", "Simple characters should come out unscathed (as attribute value)");
- String AELIG_OSLASH_ARING = "\u00e6\u00f8\u00e5"; // \
+ String AELIG_OSLASH_ARING = "\u00e6\u00f8\u00e5";
+ String NCR_AELIG_OSLASH_ARING = "æøå";
String actual2 = outputCharacters(makeStream("ISO-8859-1"), AELIG_OSLASH_ARING);
- reporter.check(actual2, AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out as entities");
+ reporter.check(actual2, NCR_AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out as Numeric Character References"+": got '"+actual2+"' expected '"+NCR_AELIG_OSLASH_ARING+"'");
String actual2a = outputAttrValue(makeStream("ISO-8859-1"), AELIG_OSLASH_ARING);
- reporter.check(actual2a, AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out as entities (as attribute value)");
+ // GONK: WRONG EXPECTED VALUE, LITERALS RATHER THAN NUMERIC CHAR REFS
+ reporter.check(actual2a, NCR_AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out as Numeric Character References (as attribute value)"+": got '"+actual2+"' expected '"+NCR_AELIG_OSLASH_ARING+"'");
- String CHINESE = "\u95c9\u6d77\u4e95"; // \
+ String CHINESE = "\u95c9\u6d77\u4e95";
String actual3 = outputCharacters(makeStream("ISO-8859-1"), CHINESE);
- reporter.check(actual3, "闉海井", "BMP characters should come out as entities");
+ reporter.check(actual3, "闉海井", "BMP characters should come out as Numeric Character References");
String actual3a = outputAttrValue(makeStream("ISO-8859-1"), CHINESE);
- reporter.check(actual3a, "闉海井", "BMP characters should come out as entities (as attribute value)");
+ reporter.check(actual3a, "闉海井", "BMP characters should come out as Numeric Character References (as attribute value)");
String utf16String = buildUtf16String(new int[] { 0x010030, 0xa4, 0x010032});
reporter.check(utf16String.length(), 5, "String with two astral characters and one in the BMP should have length of 5 UTF-16 code units");
String actual4 = outputCharacters(makeStream("ISO-8859-1"), utf16String);
- reporter.check(actual4, "𐀰\u00a4𐀲", "Astral characters should come out as entities");
+ // This was using literal for the middle character, but I think
+ // Numeric Character Entity is in fact expected...? GONK: REVIEW
+ String NCR_ASTRAL_MIX="𐀰¤𐀲";
+ reporter.check(actual4, NCR_ASTRAL_MIX, "Astral characters should come out as Numeric Character References"+": got '"+actual4+"' expected '"+NCR_ASTRAL_MIX+"'");
String actual4a = outputAttrValue(makeStream("ISO-8859-1"), utf16String);
- reporter.check(actual4a, "𐀰\u00a4𐀲", "Astral characters should come out as entities (as attribute value)");
+ // This was using literal for the middle character, but I think
+ // Numeric Character Entity is in fact expected...? GONK: REVIEW
+ reporter.check(actual4a, NCR_ASTRAL_MIX, "Astral characters should come out as Numeric Character References (as attribute value)"+": got '"+actual4+"' expected '"+NCR_ASTRAL_MIX+"'");
reporter.testCaseClose();
return true;
@@ -148,25 +156,25 @@ public class ToXMLStreamTest extends ToStreamTest
String actual1a = outputAttrValue(makeStream("ASCII"), "abc");
reporter.check(actual1a, "abc", "Simple characters should come out unscathed (as attribute value)");
- String AELIG_OSLASH_ARING = "\u00e6\u00f8\u00e5"; // \
+ String AELIG_OSLASH_ARING = "\u00e6\u00f8\u00e5";
String actual2 = outputCharacters(makeStream("ASCII"), AELIG_OSLASH_ARING);
- reporter.check(actual2, "æøå","ISO-8859-1 characters should come out as entities");
+ reporter.check(actual2, "æøå","ISO-8859-1 characters should come out as Numeric Character References");
String actual2a = outputAttrValue(makeStream("ASCII"), AELIG_OSLASH_ARING);
- reporter.check(actual2a, "æøå","ISO-8859-1 characters should come out as entities (as attribute value)");
+ reporter.check(actual2a, "æøå","ISO-8859-1 characters should come out as Numeric Character References (as attribute value)");
- String CHINESE = "\u95c9\u6d77\u4e95"; // \
+ String CHINESE = "\u95c9\u6d77\u4e95";
String actual3 = outputCharacters(makeStream("ASCII"), CHINESE);
- reporter.check(actual3, "闉海井", "BMP characters should come out as entities");
+ reporter.check(actual3, "闉海井", "BMP characters should come out as Numeric Character References");
String actual3a = outputAttrValue(makeStream("ASCII"), CHINESE);
- reporter.check(actual3a, "闉海井", "BMP characters should come out as entities (as attribute value)");
+ reporter.check(actual3a, "闉海井", "BMP characters should come out as Numeric Character References (as attribute value)");
String utf16String = buildUtf16String(new int[] { 0x010030, 0xa4, 0x010032});
reporter.check(utf16String.length(), 5, "String with two astral characters and one in the BMP should have length of 5 UTF-16 code units");
String actual4 = outputCharacters(makeStream("ASCII"), utf16String);
- reporter.check(actual4, "𐀰¤𐀲", "Astral characters should come out as entities");
+ reporter.check(actual4, "𐀰¤𐀲", "Astral characters should come out as Numeric Character References");
String actual4a = outputAttrValue(makeStream("ASCII"), utf16String);
- reporter.check(actual4a, "𐀰¤𐀲", "Astral characters should come out as entities (as attribute value)");
+ reporter.check(actual4a, "𐀰¤𐀲", "Astral characters should come out as Numeric Character References (as attribute value)");
reporter.testCaseClose();
return true;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org
For additional commands, e-mail: commits-help@xalan.apache.org