Skip to content

Commit

Permalink
CLDR-17948 kbd: quell some dtd warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
srl295 committed Sep 13, 2024
1 parent 242ff8b commit 780b53d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ public boolean isOlderThan(CldrVersion other) {
return compareTo(other) < 0;
}

public boolean isAsOldOrOlderThan(CldrVersion other) {
return compareTo(other) <= 0;
}


private CldrVersion() {
String oldName = name();
if (oldName.charAt(0) == 'v') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private static Map<DtdType, ElementAttributeInfo> makeElementAttributeInfoMap(
addElementAttributeInfo(
result,
DtdType.keyboard3,
canonicalCommonDirectory + "/../keyboards/3.0/fr-t-k0-test.xml");
canonicalCommonDirectory + "/../tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/und-t-k0-none.xml");
addElementAttributeInfo(
result,
DtdType.keyboardTest3,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file is here to quell ElementAttributeInfo warnings. It is the only keyboard file which uses a .dtd, which is not recommended. -->
<!DOCTYPE keyboard3 SYSTEM '../../../../../../../../../../keyboards/dtd/ldmlKeyboard3.dtd'>
<keyboard3 xmlns="https://schemas.unicode.org/cldr/46/keyboard3" locale="fr-t-k0-test" conformsTo="46">
<info name="Unused Keyboard, for DTD tests" />
<!-- not a real keyboard. -->
</keyboard3>
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,6 @@ private void checkDtds(
continue;
} else if (fileName.isDirectory()) {
checkDtds(fileName, level + 1, foundAttributes, data);
} else if (fileName.getPath().contains("/keyboards/3.0/")
&& logKnownIssue(
"CLDR-17574", "With v46, parsing issues for keyboard xml files")) {
; // do nothing, skip test
} else if (name.endsWith(".xml")) {
data.add(check(fileName));
if (deepCheck // takes too long to do all the time
Expand Down Expand Up @@ -1252,6 +1248,10 @@ public void TestBasicDTDCompatibility() {
continue; // DTD didn't exist in last release
}
if (dtd == DtdType.ldmlICU) continue;
if (dtd == DtdType.keyboard3 && CldrVersion.LAST_RELEASE_VERSION.isAsOldOrOlderThan(CldrVersion.v45_0)) {
// Sample file did not have a DTD in v45, moved to a new location in v46+
continue;
}
try {
ElementAttributeInfo oldDtd = ElementAttributeInfo.getInstance(oldCommon, dtd);
ElementAttributeInfo newDtd = ElementAttributeInfo.getInstance(dtd);
Expand Down Expand Up @@ -1566,11 +1566,6 @@ public void TestDtdComparisonsAll() {
&& file.getParentFile().getParentFile().getName().equals("keyboards")) {
return; // skip imports
}
if (file.getPath().contains("/keyboards/3.0/")
&& logKnownIssue(
"CLDR-17574", "With v46, parsing issues for keyboard xml files")) {
continue;
}
checkDtdComparatorFor(file, null);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,6 @@ public void TestNonLdml() {
) {
continue;
}
if (dir2.getPath().contains("/keyboards/3.0")
&& logKnownIssue(
"CLDR-17574", "With v46, parsing issues for keyboard xml files")) {
continue;
}

Set<Pair<String, String>> seen = new HashSet<>();
Set<String> seenStarred = new HashSet<>();
int count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ void TestReadCommon() throws FileNotFoundException, IOException {

@Test
void TestReadKeyboard() throws FileNotFoundException, IOException {
if (true /* TODO CLDR-17574 With v46, parsing issues for keyboard xml files */) {
return;
}
for (int i = 0; i < COUNT; i++) {
new XMLFileReader()
.setHandler(new XMLFileReader.SimpleHandler())
Expand All @@ -67,9 +64,6 @@ void TestReadKeyboard() throws FileNotFoundException, IOException {
@Test
void TestReadKeyboardByte() throws IOException, SAXException {
// verify that reading via InputStream (byte) works as well
if (true /* TODO CLDR-17574 With v46, parsing issues for keyboard xml files */) {
return;
}
try (InputStream fis = new FileInputStream(KEYBOARDS_MT); ) {
InputSource is = new InputSource(fis);
is.setSystemId(KEYBOARDS_MT);
Expand All @@ -81,9 +75,6 @@ void TestReadKeyboardByte() throws IOException, SAXException {
@Test
void TestReadKeyboardChar() throws IOException, SAXException {
// verify that reading via Reader (char) works as well
if (true /* TODO CLDR-17574 With v46, parsing issues for keyboard xml files */) {
return;
}
try (InputStream fis = new FileInputStream(KEYBOARDS_MT);
InputStreamReader isr = new InputStreamReader(fis); ) {
InputSource is = new InputSource(isr);
Expand Down

0 comments on commit 780b53d

Please sign in to comment.