diff --git a/src/windows/classes/sun/nio/fs/WindowsFileSystem.java b/src/windows/classes/sun/nio/fs/WindowsFileSystem.java index 54712098b672f852f4903548f15df79fde5914a6..2ad40cb779889bc1a384ca86b936307d77d3812e 100644 --- a/src/windows/classes/sun/nio/fs/WindowsFileSystem.java +++ b/src/windows/classes/sun/nio/fs/WindowsFileSystem.java @@ -283,25 +283,15 @@ class WindowsFileSystem } } - // match in uppercase - StringBuilder sb = new StringBuilder(expr.length()); - for (int i=0; i UNEXPECTED RESULT!"); + failures++; + } + } + + public static void main(String[] args) { // basic assertMatch("foo.html", "foo.html"); @@ -140,21 +154,13 @@ public class Basic { assertMatch("one*two", "one\\*two"); } - - // regex syntax - { - String pattern = ".*\\.html"; - System.out.format("Test regex pattern: %s", pattern); - Path file = Paths.get("foo.html"); - boolean matched = file.getFileSystem() - .getPathMatcher("regex:" + pattern).matches(file); - if (matched) { - System.out.println(" OKAY"); - } else { - System.out.println(" ==> UNEXPECTED RESULT!"); - failures++; - } + assertRegExMatch("foo.html", ".*\\.html"); + + if (System.getProperty("os.name").startsWith("Windows")) { + assertRegExMatch("foo012", "foo\\d+"); + assertRegExMatch("fo o", "fo\\so"); + assertRegExMatch("foo", "\\w+"); } // unknown syntax