diff --git a/src/test/scala/minisql/ast/FromExprsSuite.scala b/src/test/scala/minisql/ast/FromExprsSuite.scala index 9cab3b1..70a0d6d 100644 --- a/src/test/scala/minisql/ast/FromExprsSuite.scala +++ b/src/test/scala/minisql/ast/FromExprsSuite.scala @@ -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")) }