From d4365347fc7a7725badd22704974d43ed996cfc0 Mon Sep 17 00:00:00 2001 From: Tracy Barlow Date: Sun, 6 Dec 2026 13:08:44 +0000 Subject: [PATCH] TEST: Compare the example page's lines the same way on Windows ExampleControllerTests.page_LabelsEachValueAndEndsWithFindOutMore failed on every Windows entry and passed on Ubuntu and macOS. It reads example.jsp and looks for lines joined by \n, but the Windows runners set core.autocrlf, so git checks the page out there with \r\n, and .gitattributes has no rule for a JSP. The test now turns \r\n into \n after reading the page, so it checks the same text everywhere. --- .../web/examples/mvc/controller/ExampleControllerTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/location/geo-location.web.examples/geo-location.web.examples.mvc/src/test/java/fiftyone/geolocation/web/examples/mvc/controller/ExampleControllerTests.java b/location/geo-location.web.examples/geo-location.web.examples.mvc/src/test/java/fiftyone/geolocation/web/examples/mvc/controller/ExampleControllerTests.java index 9f7e3acf0..6b437553e 100644 --- a/location/geo-location.web.examples/geo-location.web.examples.mvc/src/test/java/fiftyone/geolocation/web/examples/mvc/controller/ExampleControllerTests.java +++ b/location/geo-location.web.examples/geo-location.web.examples.mvc/src/test/java/fiftyone/geolocation/web/examples/mvc/controller/ExampleControllerTests.java @@ -93,10 +93,12 @@ public void get_GivesThePaidMessageAndFindOutMore() { @Test public void page_LabelsEachValueAndEndsWithFindOutMore() throws IOException { + // A checkout on Windows can end each line with \r\n, so the lines + // are compared with \n alone. String page = new String(Files.readAllBytes(Paths.get( System.getProperty("basedir", "."), "src/main/webapp/WEB-INF/views/example.jsp")), - StandardCharsets.UTF_8); + StandardCharsets.UTF_8).replace("\r\n", "\n"); assertTrue(page, page.contains("
Country
\n" + " ${country}")); assertTrue(page, page.contains("
County
\n" +