|
27 | 27 | public final class SNBTParserTest { |
28 | 28 |
|
29 | 29 | private static void assertIntegral(long expectedValue, SNBTParser.IntegralType expectedType, boolean expectedUnsigned, String value) { |
30 | | - assertEquals(new SNBTParser.Token.IntegralToken(expectedValue, expectedType, expectedUnsigned), SNBTParser.parseNumberToken(value)); |
| 30 | + assertEquals(new SNBTParser.Token.IntegralToken(expectedValue, expectedType, expectedUnsigned), SNBTParser.parseNumberToken(value), value); |
31 | 31 | } |
32 | 32 |
|
33 | 33 | @ParameterizedTest |
34 | 34 | @EnumSource |
35 | 35 | void testParseNumberToken(SNBTParser.IntegralType type) { |
36 | 36 | List<String> defaultSuffixes = List.of(type.name().substring(0, 1), type.name().substring(0, 1).toLowerCase(Locale.ROOT)); |
37 | | - List<String> signedSuffixes = defaultSuffixes.stream().flatMap(suffix -> Stream.of(suffix, "s" + suffix, "S" + suffix)).toList(); |
| 37 | + List<String> signedSuffixes = defaultSuffixes.stream().flatMap(suffix -> Stream.of("s" + suffix, "S" + suffix)).toList(); |
38 | 38 | List<String> unsignedSuffixes = defaultSuffixes.stream().flatMap(suffix -> Stream.of("u" + suffix, "U" + suffix)).toList(); |
39 | 39 |
|
40 | 40 | for (String suffix : defaultSuffixes) { |
41 | 41 | if (type != SNBTParser.IntegralType.BYTE) {// 0b is binary integer prefix |
42 | 42 | assertIntegral(0L, type, false, "0" + suffix); |
| 43 | + assertIntegral(0L, type, true, "0x0" + suffix); |
| 44 | + assertIntegral(0L, type, true, "0X0" + suffix); |
43 | 45 | } |
44 | 46 |
|
45 | 47 | assertIntegral(0L, type, true, "0b0" + suffix); |
46 | 48 | assertIntegral(0L, type, true, "0B0" + suffix); |
47 | | - assertIntegral(0L, type, true, "0X0" + suffix); |
| 49 | + |
48 | 50 | } |
49 | 51 |
|
50 | 52 | for (String signedSuffix : signedSuffixes) { |
|
0 commit comments