Skip to content

Commit 26fe68b

Browse files
committed
CLDR-17829 fix cldr-apps test
- test was failing because URLs are now in the references instead of inline
1 parent 90c00fe commit 26fe68b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tools/cldr-apps/src/test/java/org/unicode/cldr/util/TestCLDRLinks.java

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.unicode.cldr.util;
22

33
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
45
import static org.junit.jupiter.api.Assertions.assertTrue;
56
import static org.junit.jupiter.api.Assumptions.assumeTrue;
67

@@ -65,6 +66,11 @@ public void TestPathDescriptionLinks(final String url, final String xpath)
6566
assertURLOK(url, xpath);
6667
}
6768

69+
@Test
70+
void testPathDescriptionProvider() {
71+
assertNotEquals(0, pathDescriptionProvider().count());
72+
}
73+
6874
/**
6975
* Provider for above test
7076
*
@@ -83,13 +89,23 @@ public static Stream<Arguments> pathDescriptionProvider() {
8389

8490
final Map<String, String> urls = new TreeMap<String, String>();
8591

92+
// this gets any URLs that are not in the footer
8693
for (final String xpath : english.fullIterable()) {
8794
final String description = pathDescriptionFactory.getRawDescription(xpath, null);
8895
// System.out.println(description);
8996
for (final String url : urlsFromString(description)) {
9097
urls.putIfAbsent(url, xpath);
9198
}
9299
}
100+
101+
// this gets all URLs in references
102+
PathDescriptionParser pathDescriptionParser = new PathDescriptionParser();
103+
pathDescriptionParser.parse(PathDescription.getPathDescriptionString());
104+
for (final String url : urlsFromString(pathDescriptionParser.getReferences())) {
105+
urls.putIfAbsent(url, "PathDescriptions.md");
106+
}
107+
108+
assertNotEquals(0, urls.size(), "PathDescription had no urls");
93109
return urls.entrySet().stream().map(e -> Arguments.of(e.getKey(), e.getValue()));
94110
}
95111

0 commit comments

Comments
 (0)