Browse Source

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>
tags/V1_9_8_RC1
Alexander Kriegisch 2 years ago
parent
commit
4ebacb3939

+ 2
- 1
tests/features198/java17/SwitchPatternAspect.aj View File

@@ -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();
});

+ 2
- 1
tests/features198/java17/SwitchPatternOK.java View File

@@ -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();
};

+ 2
- 2
tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml View File

@@ -42,7 +42,7 @@
<line text="null" />
<line text="int 123" />
<line text="long 999" />
<line text="double 12,340000" />
<line text="double 12.340000" />
<line text="String foo" />
<line text="[123, foo, 999, 12.34]" />
<line text="Non-circle" />
@@ -63,7 +63,7 @@
<line text="null" />
<line text="int 123" />
<line text="long 999" />
<line text="double 12,340000" />
<line text="double 12.340000" />
<line text="String foo" />
<line text="[123, foo, 999, 12.34]" />
<line text="Non-circle" />

Loading…
Cancel
Save