Skip to content

Commit 281265e

Browse files
committed
add constant type tests
1 parent f66fb55 commit 281265e

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
public class J {
2+
public static final boolean BooleanTrue = true;
3+
public static final boolean BooleanFalse = false;
4+
public static final boolean InvertedBoolean = !true;
5+
6+
public static final byte PositiveByte = 23;
7+
public static final byte NegativeByte = -42;
8+
public static final byte LiteralCharAsByte = 'a';
9+
10+
public static final char NumChar = 33;
11+
public static final char LiteralChar = 'b';
12+
13+
public static final short PositiveShort = 0x1234;
14+
public static final short NegativeShort= -0x5678;
15+
public static final short LiteralCharAsShort = 'c';
16+
17+
public static final int PositiveInt = 0xabcdef;
18+
public static final int NegativeInt = -12345678;
19+
public static final int LiteralCharAsInt = 'd';
20+
21+
public static final long PositiveLong = 0x1234567890abcdefL;
22+
public static final long NegativeLong = -0xfedcba09876L;
23+
public static final long LiteralCharAsLong = 'e';
24+
public static final long LiteralIntAsLong = 0x12345678;
25+
26+
public static final float PositiveFloat = 42.232323f;
27+
public static final float NegativeFloat = -3.1415f;
28+
29+
public static final double PositiveDouble = 23.4243598374594d;
30+
public static final double NegativeDouble = -42.2324358934589734859d;
31+
32+
public static final String RegularString = "testConstant";
33+
public static final String NegativeString = "!#!$!grml%!%!$#@@@";
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
object S {
2+
val BooleanTrue: true = J.BooleanTrue
3+
val BooleanFalse: false = J.BooleanFalse
4+
val InvertedBoolean: false = J.InvertedBoolean
5+
6+
val PositiveByte: 23 = J.PositiveByte
7+
val NegativeByte: -42 = J.NegativeByte
8+
val LiteralCharAsByte: 'a' = J.LiteralCharAsByte
9+
10+
val NumChar: 33 = J.NumChar
11+
val LiteralChar: 'b' = J.LiteralChar
12+
13+
val PositiveShort: 0x1234 = J.PositiveShort
14+
val NegativeShort: -0x5678 = J.NegativeShort
15+
val LiteralCharAsShort: 'c' = J.LiteralCharAsShort
16+
17+
val PositiveInt: 0xabcdef = J.PositiveInt
18+
val NegativeInt: -12345678 = J.NegativeInt
19+
val LiteralCharAsInt: 'd' = J.LiteralCharAsInt
20+
21+
val PositiveLong: 0x1234567890abcdefL = J.PositiveLong
22+
val NegativeLong: -0xfedcba09876L = J.NegativeLong
23+
val LiteralCharAsLong: 'e' = J.LiteralCharAsLong
24+
val LiteralIntAsLong: 0x12345678 = J.LiteralIntAsLong
25+
26+
val PositiveFloat: 42.232323f = J.PositiveFloat
27+
val NegativeFloat: -3.1415f = J.NegativeFloat
28+
29+
val PositiveDouble: 23.4243598374594d = J.PositiveDouble
30+
val NegativeDouble: -42.2324358934589734859d = J.NegativeDouble
31+
32+
val RegularString: "testConstant" = J.RegularString
33+
val NegativeString: "!#!$!grml%!%!$#@@@" = J.NegativeString
34+
}

0 commit comments

Comments
 (0)