]> source.dussan.org Git - poi.git/commitdiff
Make new tests for IOUtils work on Windows as well
authorDominik Stadler <centic@apache.org>
Wed, 24 Mar 2021 09:30:34 +0000 (09:30 +0000)
committerDominik Stadler <centic@apache.org>
Wed, 24 Mar 2021 09:30:34 +0000 (09:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887997 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/util/TestIOUtils.java

index 4c9f6a1fb74c20f8b9a22569dd5c776fe5dd9437..19b64dd3c17fa546fdf0701abc191999cc676b63 100644 (file)
@@ -202,7 +202,11 @@ final class TestIOUtils {
     void testCopyToInvalidFile() throws IOException {
         try (InputStream is = new FileInputStream(TMP)) {
             assertThrows(RuntimeException.class,
-                    () -> IOUtils.copy(is, new File("/notexisting/directory/structure")));
+                    () -> {
+                        // try with two different paths so we fail on both Unix and Windows
+                        IOUtils.copy(is, new File("/notexisting/directory/structure"));
+                        IOUtils.copy(is, new File("c:\\note&/()\"§=§%&!§$81§0_:;,.-'#*+~`?ß´ß0´ß9243xisting\\directory\\structure"));
+                    });
         }
     }