-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parser): add simple test for type annotation
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(library | ||
(name tests) | ||
(modules test_parser) | ||
(libraries arML_lib parser ast) | ||
(inline_tests) | ||
(preprocess | ||
(pps ppx_expect ppx_deriving.show))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(* * Copyright 2024, raf-nr and ksenmel *) | ||
|
||
(** SPDX-License-Identifier: LGPL-3.0-or-later *) | ||
|
||
open Base | ||
|
||
let run code = | ||
match Parser.parse code with | ||
| Ok ast -> Stdlib.Format.printf "%a\n" Ast.pp_program ast | ||
| Error s -> Stdlib.Format.printf "Parsing error: %s\n" s | ||
;; | ||
|
||
let%expect_test "simple annotation" = | ||
run "let (x : int) = 3" ; |