Skip to content

Commit 5421c2a

Browse files
committed
Readapt tests
1 parent d82f4c8 commit 5421c2a

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

tests/run-custom-args/Yretain-trees/tasty-definitions-2/Macro_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object Foo {
1515
}
1616
x.unseal match {
1717
case Term.Inlined(None, Nil, arg) => definitionString(arg)
18-
case Term.Block(Nil, arg) => definitionString(arg) // TODO should all by name parameters be in an inline node?
18+
case arg => definitionString(arg) // TODO should all by name parameters be in an inline node?
1919
}
2020
}
2121

tests/run-custom-args/Yretain-trees/tasty-definitions-3/Macro_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object Foo {
1515
}
1616
x.unseal match {
1717
case Term.Inlined(None, Nil, arg) => definitionString(arg)
18-
case Term.Block(Nil, arg) => definitionString(arg) // TODO should all by name parameters be in an inline node?
18+
case arg => definitionString(arg) // TODO should all by name parameters be in an inline node?
1919
}
2020
}
2121
}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
DefDef("foo", Nil, Nil, TypeTree.Ident("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(1)), "+"), List(Term.Literal(Constant.Int(2))))))
2-
NO DEFINTION
2+
ValDef("bar", TypeTree.Ident("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(2)), "+"), List(Term.Literal(Constant.Int(3))))))
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
DefDef("foo", Nil, Nil, TypeTree.Ident("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(1)), "+"), List(Term.Literal(Constant.Int(2))))))
2-
NO DEFINTION
2+
ValDef("bar", TypeTree.Ident("Int"), Some(Term.Apply(Term.Select(Term.Literal(Constant.Int(2)), "+"), List(Term.Literal(Constant.Int(3))))))

tests/run/tasty-argument-tree-1.check

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11

2-
tree: Term.Block(Nil, Term.Literal(Constant.Int(3)))
2+
tree: Term.Literal(Constant.Int(3))
33
tree deref. vals: Term.Literal(Constant.Int(3))
44

5-
tree: Term.Block(Nil, Term.Ident("v"))
5+
tree: Term.Ident("v")
66
tree deref. vals: Term.Literal(Constant.Int(1))
77

8-
tree: Term.Block(Nil, Term.Ident("x"))
8+
tree: Term.Ident("x")
99
tree deref. vals: Term.Literal(Constant.Int(2))
1010

11-
tree: Term.Block(Nil, Term.Ident("l"))
11+
tree: Term.Ident("l")
1212
tree deref. vals: Term.Literal(Constant.Int(3))
1313

14-
tree: Term.Block(Nil, Term.Ident("a"))
14+
tree: Term.Ident("a")
1515
tree deref. vals: Term.Ident("a")
1616

17-
tree: Term.Block(Nil, Term.Ident("x"))
17+
tree: Term.Ident("x")
1818
tree deref. vals: Term.Ident("b")
1919

20-
tree: Term.Block(Nil, Term.Ident("vv"))
20+
tree: Term.Ident("vv")
2121
tree deref. vals: Term.Literal(Constant.Int(1))
2222

23-
tree: Term.Block(Nil, Term.Ident("x"))
23+
tree: Term.Ident("x")
2424
tree deref. vals: Term.Literal(Constant.Int(1))
2525

26-
tree: Term.Block(Nil, Term.Ident("vd"))
26+
tree: Term.Ident("vd")
2727
tree deref. vals: Term.Literal(Constant.Int(2))
2828

29-
tree: Term.Block(Nil, Term.Ident("x"))
29+
tree: Term.Ident("x")
3030
tree deref. vals: Term.Literal(Constant.Int(2))
3131

32-
tree: Term.Block(Nil, Term.Ident("x"))
32+
tree: Term.Ident("x")
3333
tree deref. vals: Term.Apply(Term.TypeApply(Term.Select(Term.Ident("Tuple2"), "apply"), List(TypeTree.Inferred(), TypeTree.Inferred())), List(Term.Literal(Constant.Int(1)), Term.Literal(Constant.Int(2))))

tests/run/tasty-extractors-1.check

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
Term.Block(Nil, Term.Literal(Constant.Boolean(true)))
1+
Term.Literal(Constant.Boolean(true))
22
Type.ConstantType(Constant.Boolean(true))
33

4-
Term.Block(Nil, Term.Literal(Constant.Int(1)))
4+
Term.Literal(Constant.Int(1))
55
Type.ConstantType(Constant.Int(1))
66

7-
Term.Block(Nil, Term.Literal(Constant.Long(2)))
7+
Term.Literal(Constant.Long(2))
88
Type.ConstantType(Constant.Long(2))
99

10-
Term.Block(Nil, Term.Literal(Constant.Float(2.1)))
10+
Term.Literal(Constant.Float(2.1))
1111
Type.ConstantType(Constant.Float(2.1))
1212

13-
Term.Block(Nil, Term.Literal(Constant.Double(2.2)))
13+
Term.Literal(Constant.Double(2.2))
1414
Type.ConstantType(Constant.Double(2.2))
1515

16-
Term.Block(Nil, Term.Literal(Constant.String("abc")))
16+
Term.Literal(Constant.String("abc"))
1717
Type.ConstantType(Constant.String("abc"))
1818

1919
Term.Inlined(None, Nil, Term.Apply(Term.Ident("println"), List(Term.Literal(Constant.String("abc")))))
@@ -28,7 +28,7 @@ Type.SymRef(IsClassSymbol(<scala.Byte>), Type.SymRef(IsPackageSymbol(<scala>), T
2828
Term.Inlined(None, Nil, Term.Typed(Term.Literal(Constant.Short(8)), TypeTree.Ident("Short")))
2929
Type.SymRef(IsClassSymbol(<scala.Short>), Type.SymRef(IsPackageSymbol(<scala>), Type.ThisType(Type.SymRef(IsPackageSymbol(<<root>>), NoPrefix()))))
3030

31-
Term.Block(Nil, Term.Literal(Constant.Char(a)))
31+
Term.Literal(Constant.Char(a))
3232
Type.ConstantType(Constant.Char(a))
3333

3434
Term.Inlined(None, Nil, Term.Block(List(Term.Literal(Constant.Int(1)), Term.Literal(Constant.Int(2))), Term.Literal(Constant.Int(3))))

tests/run/tasty-extractors-2.check

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Type.AppliedType(Type.SymRef(IsClassSymbol(<scala.Function1>), Type.ThisType(Typ
77
Term.Inlined(None, Nil, Term.Ident("???"))
88
Type.SymRef(IsDefSymbol(<scala.Predef$.???>), Type.SymRef(IsValSymbol(<scala.Predef>), Type.ThisType(Type.SymRef(IsPackageSymbol(<scala>), NoPrefix()))))
99

10-
Term.Block(Nil, Term.Literal(Constant.Int(1)))
10+
Term.Literal(Constant.Int(1))
1111
Type.ConstantType(Constant.Int(1))
1212

1313
Term.Inlined(None, Nil, Term.Typed(Term.Literal(Constant.Int(1)), TypeTree.Ident("Int")))

tests/run/tasty-macro-const/quoted_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object Macros {
99
import reflection._
1010
val xTree: Term = x.unseal
1111
xTree match {
12-
case Term.Block(Nil, Term.Literal(Constant.Int(n))) =>
12+
case Term.Literal(Constant.Int(n)) =>
1313
if (n <= 0)
1414
throw new QuoteError("Parameter must be natural number")
1515
xTree.seal[Int]

0 commit comments

Comments
 (0)