aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkizune <none@none>2013-11-18 20:22:49 +0400
committerkizune <none@none>2013-11-18 20:22:49 +0400
commit0b875cd9384e7be96c59b24e31c939eefb13c07d (patch)
tree8dd260383d543e804b20a344a7191550398defc8 /test
parent597be4e73e60b983b214108c3e26e4113dbc89a3 (diff)
8028197: tools/launcher/DiacriticTest.java failed on MacOSX: Input length = 1
Reviewed-by: ksrini
Diffstat (limited to 'test')
-rw-r--r--test/tools/launcher/DiacriticTest.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/tools/launcher/DiacriticTest.java b/test/tools/launcher/DiacriticTest.java
index e43cedffc..34b894b43 100644
--- a/test/tools/launcher/DiacriticTest.java
+++ b/test/tools/launcher/DiacriticTest.java
@@ -30,6 +30,8 @@
import java.io.File;
import java.io.IOException;
+import java.nio.file.InvalidPathException;
+import java.nio.charset.UnmappableCharacterException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -46,6 +48,13 @@ public class DiacriticTest extends TestHelper {
return;
}
+ String lang = System.getenv("LANG");
+ if (lang != null && !lang.contains("UTF-8")) {
+ System.out.println("LANG variable set to the language that " +
+ "does not support unicode, test passes vacuously");
+ return;
+ }
+
File sourceFile = new File(NAME_NFC + ".java");
String source = "public class " + NAME_NFC + " { " +
" public static void main(String args[]) {\n" +
@@ -56,7 +65,7 @@ public class DiacriticTest extends TestHelper {
content.add(source);
try {
createFile(sourceFile, content);
- } catch (java.nio.file.InvalidPathException ipe) {
+ } catch (UnmappableCharacterException | InvalidPathException ipe) {
System.out.println("The locale or file system is configured in a way " +
"that prevents file creation. Real testing impossible.");
return;