aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features198
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2021-10-08 07:23:44 +0200
committerAlexander Kriegisch <Alexander@Kriegisch.name>2021-10-08 07:23:44 +0200
commit4ebacb393999f12ed80baf96c376b09226a46779 (patch)
treef07da11c64465da044d6879f28de2f250f434d78 /tests/features198
parentf7b7843748366c7310b165b2c3fc088b2c65d245 (diff)
downloadaspectj-4ebacb393999f12ed80baf96c376b09226a46779.tar.gz
aspectj-4ebacb393999f12ed80baf96c376b09226a46779.zip
Fix Java17PreviewFeaturesTests (locale-specific floating-point output)
The test worked on my local workstation with German locale, but not on GitHub with English locale. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/features198')
-rw-r--r--tests/features198/java17/SwitchPatternAspect.aj3
-rw-r--r--tests/features198/java17/SwitchPatternOK.java3
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/features198/java17/SwitchPatternAspect.aj b/tests/features198/java17/SwitchPatternAspect.aj
index 5a3eeeb30..bf19b8468 100644
--- a/tests/features198/java17/SwitchPatternAspect.aj
+++ b/tests/features198/java17/SwitchPatternAspect.aj
@@ -1,4 +1,5 @@
import java.util.List;
+import java.util.Locale;
aspect SwitchPatternAspect {
Object around(Object o) : execution(* doSomethingWithObject(*)) && args(o) {
@@ -6,7 +7,7 @@ aspect SwitchPatternAspect {
case null -> "null";
case Integer i -> String.format("int %d", i);
case Long l -> String.format("long %d", l);
- case Double d -> String.format("double %f", d);
+ case Double d -> String.format(Locale.ENGLISH, "double %f", d);
case String s -> String.format("String %s", s);
default -> o.toString();
});
diff --git a/tests/features198/java17/SwitchPatternOK.java b/tests/features198/java17/SwitchPatternOK.java
index 26c1cf755..586dfe020 100644
--- a/tests/features198/java17/SwitchPatternOK.java
+++ b/tests/features198/java17/SwitchPatternOK.java
@@ -1,4 +1,5 @@
import java.util.List;
+import java.util.Locale;
/**
* Inspired by examples in https://openjdk.java.net/jeps/406
@@ -26,7 +27,7 @@ public class SwitchPatternOK {
case null -> "null";
case Integer i -> String.format("int %d", i);
case Long l -> String.format("long %d", l);
- case Double d -> String.format("double %f", d);
+ case Double d -> String.format(Locale.ENGLISH, "double %f", d);
case String s -> String.format("String %s", s);
default -> o.toString();
};