Skip to content

Commit 86f72c6

Browse files
committed
Add tests for all Constant extractors
1 parent b86d6b8 commit 86f72c6

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

tests/run-with-compiler/tasty-extractors.check

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ ConstantType(Int(1))
77
Literal(Long(2))
88
ConstantType(Long(2))
99

10-
Literal(Double(2.0))
11-
ConstantType(Double(2.0))
10+
Literal(Float(2.1))
11+
ConstantType(Float(2.1))
12+
13+
Literal(Double(2.2))
14+
ConstantType(Double(2.2))
1215

1316
Literal(String("abc"))
1417
ConstantType(String("abc"))
@@ -19,6 +22,15 @@ Apply(Ident(println), List(Literal(String("abc"))))
1922
Typed(Literal(Int(8)), Ident(Int))
2023
NameRef(Int, ###)
2124

25+
Typed(Literal(Byte(8)), Ident(Byte))
26+
NameRef(Byte, ###)
27+
28+
Typed(Literal(Short(8)), Ident(Short))
29+
NameRef(Short, ###)
30+
31+
Literal(Char('a'))
32+
ConstantType(Char('a'))
33+
2234
Block(List(Literal(Int(1)), Literal(Int(2))), Literal(Int(3)))
2335
ConstantType(Int(3))
2436

tests/run-with-compiler/tasty-extractors.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ object Test {
2828
'(true),
2929
'(1),
3030
'(2L),
31-
'(2d),
31+
'(2.1f),
32+
'(2.2d),
3233
'("abc"),
3334
'(println("abc")),
3435
'(8: Int),
36+
'(8: Byte),
37+
'(8: Short),
38+
'( 'a' ),
3539
'{ 1; 2; 3 },
3640
'(if (true: Boolean) 1 else 2),
3741
'("a" match { case "a" => () }),

0 commit comments

Comments
 (0)