Skip to content

Commit 30cc3e9

Browse files
committed
port SI-3236 tests
1 parent 281265e commit 30cc3e9

14 files changed

+174
-68
lines changed

tests/pos/literal-constant-fields-java/J.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

tests/pos/literal-constant-fields-java/S.scala

Lines changed: 0 additions & 34 deletions
This file was deleted.

tests/pos/t3236/AnnotationTest.scala

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
trait AnnotationTest {
2+
@BooleanAnnotation(Constants.BooleanTrue)
3+
@ByteAnnotation(Constants.Byte)
4+
@CharAnnotation(Constants.Char)
5+
@ShortAnnotation(Constants.Short)
6+
@IntAnnotation(Constants.Int)
7+
@LongAnnotation(Constants.Long)
8+
@FloatAnnotation(Constants.Float)
9+
@DoubleAnnotation(Constants.Double)
10+
@StringAnnotation(Constants.String)
11+
def test1: Unit
12+
13+
@BooleanAnnotation(Constants.InvertedBoolean)
14+
@ByteAnnotation(Constants.NegativeByte)
15+
@ShortAnnotation(Constants.NegativeShort)
16+
@IntAnnotation(Constants.NegativeInt)
17+
@LongAnnotation(Constants.NegativeLong)
18+
@FloatAnnotation(Constants.NegativeFloat)
19+
@DoubleAnnotation(Constants.NegativeDouble)
20+
@StringAnnotation(Constants.NegativeString)
21+
def test2: Unit
22+
23+
@BooleanAnnotation(Constants.BooleanFalse)
24+
@ByteAnnotation(Constants.LiteralCharAsByte)
25+
@CharAnnotation(Constants.LiteralChar)
26+
@ShortAnnotation(Constants.LiteralCharAsShort)
27+
@IntAnnotation(Constants.LiteralCharAsInt)
28+
@LongAnnotation(Constants.LiteralCharAsLong)
29+
def test3: Unit
30+
31+
@LongAnnotation(Constants.LiteralIntAsLong)
32+
def test4: Unit
33+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import java.lang.annotation.Retention;
2+
import java.lang.annotation.RetentionPolicy;
3+
4+
@Retention(RetentionPolicy.RUNTIME)
5+
public @interface BooleanAnnotation {
6+
boolean value();
7+
}

tests/pos/t3236/ByteAnnotation.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import java.lang.annotation.Retention;
2+
import java.lang.annotation.RetentionPolicy;
3+
4+
@Retention(RetentionPolicy.RUNTIME)
5+
public @interface ByteAnnotation {
6+
byte value();
7+
}

tests/pos/t3236/CharAnnotation.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import java.lang.annotation.Retention;
2+
import java.lang.annotation.RetentionPolicy;
3+
4+
@Retention(RetentionPolicy.RUNTIME)
5+
public @interface CharAnnotation {
6+
char value();
7+
}

tests/pos/t3236/Constants.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
public class Constants {
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 Byte = 23;
7+
public static final byte NegativeByte = -42;
8+
public static final byte LiteralCharAsByte = 'a';
9+
10+
public static final char Char = 33;
11+
public static final char LiteralChar = 'b';
12+
13+
public static final short Short = 0x1234;
14+
public static final short NegativeShort= -0x5678;
15+
public static final short LiteralCharAsShort = 'c';
16+
17+
public static final int Int = 0xabcdef;
18+
public static final int NegativeInt = -12345678;
19+
public static final int LiteralCharAsInt = 'd';
20+
21+
public static final long Long = 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 Float = 42.232323f;
27+
public static final float NegativeFloat = -3.1415f;
28+
29+
public static final double Double = 23.4243598374594d;
30+
public static final double NegativeDouble = -42.2324358934589734859d;
31+
32+
public static final String String = "testConstant";
33+
public static final String NegativeString = "!#!$!grml%!%!$#@@@";
34+
}

tests/pos/t3236/DoubleAnnotation.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import java.lang.annotation.Retention;
2+
import java.lang.annotation.RetentionPolicy;
3+
4+
@Retention(RetentionPolicy.RUNTIME)
5+
public @interface DoubleAnnotation {
6+
double value();
7+
}

tests/pos/t3236/FloatAnnotation.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import java.lang.annotation.Retention;
2+
import java.lang.annotation.RetentionPolicy;
3+
4+
@Retention(RetentionPolicy.RUNTIME)
5+
public @interface FloatAnnotation {
6+
float value();
7+
}

tests/pos/t3236/IntAnnotation.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import java.lang.annotation.Retention;
2+
import java.lang.annotation.RetentionPolicy;
3+
4+
@Retention(RetentionPolicy.RUNTIME)
5+
public @interface IntAnnotation {
6+
int value();
7+
}

0 commit comments

Comments
 (0)