diff options
author | Marc Coquand <marc@mccd.space> | 2023-12-26 09:25:58 -0600 |
---|---|---|
committer | Marc Coquand <marc@mccd.space> | 2023-12-26 09:57:19 -0600 |
commit | 8ac0e27adc8d14a77427351dede1757999c8c709 (patch) | |
tree | 21136e7f4e467c9441176358ac0af7421e332fdf /test | |
parent | cb124a87d8ed1a309b00c9163cde2911ee029251 (diff) | |
download | fixgen-8ac0e27adc8d14a77427351dede1757999c8c709.tar.gz fixgen-8ac0e27adc8d14a77427351dede1757999c8c709.tar.bz2 fixgen-8ac0e27adc8d14a77427351dede1757999c8c709.zip |
Support many newlines
Diffstat (limited to 'test')
-rw-r--r-- | test/test_parser.ml | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/test/test_parser.ml b/test/test_parser.ml index 405219e..c677869 100644 --- a/test/test_parser.ml +++ b/test/test_parser.ml @@ -12,28 +12,27 @@ let test_parse s () = check bool "Parses" (Option.is_some ast) true -let table_suite = - [ "Can use underscore for table names", `Quick, test_parse "user_all: name uuidv4" ] - - let rows_suite = - [ "Can parse uuidv4", `Quick, test_parse "user: id uuidv4" + [ "Can parse uuidv4", `Quick, test_parse "user: id _uuidv4" ; ( "Can parse multiple tables" , `Quick - , test_parse "user: id uuidv4\npurchases: id uuidv4" ) - ; "Resolves conflicting names", `Quick, test_parse "purchases: name uuidv4" + , test_parse "user: id _uuidv4\npurchases: id _uuidv4" ) + ; "Resolves conflicting names", `Quick, test_parse "purchases: name _uuidv4" + ; "Supports names", `Quick, test_parse "purchases: name _name" ] let relations_suite = [ ( "Can reference other tables" , `Quick - , test_parse "user: id uuidv4\npurchases: id uuidv4, user_id user.id" ) - ; "Can use ; as a separator", `Quick, test_parse "user: id uuidv4; purchases: id uuidv4" + , test_parse "user: id _uuidv4\npurchases: id _uuidv4, userid user.id" ) + ; ( "Can use ; as a separator" + , `Quick + , test_parse "user: id _uuidv4; purchases: id _uuidv4" ) + ; ( "Supports multiple newlines" + , `Quick + , test_parse "user: id _uuidv4\n\n\n\n\npurchases: id _uuidv4" ) ] -let () = - Alcotest.run - "Parsing" - [ "Tables", table_suite; "Rows", rows_suite; "Relations", relations_suite ] +let () = Alcotest.run "Parsing" [ "Rows", rows_suite; "Relations", relations_suite ] |