adding futher unit tests with alcotest

This commit is contained in:
simon petit 2024-11-29 15:47:43 +00:00
parent 34ccc51b79
commit 8f3ec93f82

15
test/test_ast.ml Normal file
View File

@ -0,0 +1,15 @@
open Ast
let parse query =
let lexbuf = Lexing.from_string query in
Parser.main Lexer.read_token lexbuf
let equal_ast ast1 ast2 =
ast1 = ast2
let
let test_simple_select() =
let q1 = parse "SELECT a FROM t" in
let ast1 = Query(Select([Column("a")], [Table("t")])) in
Alcotest.(check