Better test case
This commit is contained in:
parent
ed1952b915
commit
071b27abcf
1 changed files with 28 additions and 2 deletions
|
@ -75,7 +75,10 @@ class FromExprsSuite extends FunSuite {
|
|||
|
||||
testFor("Action - Returning") {
|
||||
Returning(
|
||||
Insert(Ident("table"), List(Assignment(Ident("x"), Ident("col"), Ident("val")))),
|
||||
Insert(
|
||||
Ident("table"),
|
||||
List(Assignment(Ident("x"), Ident("col"), Ident("val")))
|
||||
),
|
||||
Ident("x"),
|
||||
Property(Ident("x"), "id")
|
||||
)
|
||||
|
@ -83,12 +86,35 @@ class FromExprsSuite extends FunSuite {
|
|||
|
||||
testFor("Action - ReturningGenerated") {
|
||||
ReturningGenerated(
|
||||
Insert(Ident("table"), List(Assignment(Ident("x"), Ident("col"), Ident("val")))),
|
||||
Insert(
|
||||
Ident("table"),
|
||||
List(Assignment(Ident("x"), Ident("col"), Ident("val")))
|
||||
),
|
||||
Ident("x"),
|
||||
Property(Ident("x"), "generatedId")
|
||||
)
|
||||
}
|
||||
|
||||
testFor("Action - Val outside") {
|
||||
val p1 = Update(
|
||||
Ident("table"),
|
||||
List(Assignment(Ident("x"), Ident("col"), Ident("val")))
|
||||
)
|
||||
val p2 = Ident("x")
|
||||
val p3 = Property(Ident("x"), "id")
|
||||
Returning(p1, p2, p3)
|
||||
}
|
||||
|
||||
testFor("Action - ReturningGenerated with Update") {
|
||||
val p1 = Update(
|
||||
Ident("table"),
|
||||
List(Assignment(Ident("x"), Ident("col"), Ident("val")))
|
||||
)
|
||||
val p2 = Ident("x")
|
||||
val p3 = Property(Ident("x"), "id")
|
||||
ReturningGenerated(p1, p2, p3)
|
||||
}
|
||||
|
||||
testFor("If expression") {
|
||||
If(Ident("cond"), Ident("then"), Ident("else"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue