On Thu, 25 Jul 2024 14:54:46 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> modules/javafx.graphics/src/test/java/test/javafx/scene/CssStyleHelperTest.java >> line 699: >> >>> 697: >>> 698: // Note: on Windows, the message is using inconsistent line >>> endings (sometimes Windows, sometimes Linux) >>> 699: // so I've stripped it. >> >> would looking for substrings be a better solution? for example: >> >> >> contains("Caught java.lang.IllegalArgumentException: Loop detected in >> *.root{") && >> contains("while resolving '-fx-base'' while calculating value for >> '-fx-background-color' from rule '*.pane' in stylesheet" > > Yeah, this seems less fragile. If we ever run into a problem because the > message changes slightly, we could consider such a change in the future. I'm not sure what way is being advocated. It seems both of you favor a contains check? For me, I always verify strings intended for user consumption completely so that any change would fail a test. If the change is intended (like fixing the missing line feeds), then the string can be fixed at the same time. With the complete string, the test also serves as a way to see the full output (which in this case, is a bit abysmal, so perhaps we should follow up with a fix). ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1505#discussion_r1701968325