summaryrefslogtreecommitdiff
path: root/dhall/tests
diff options
context:
space:
mode:
authorNadrieril2019-03-02 22:21:43 +0100
committerNadrieril2019-03-02 22:25:38 +0100
commit54d3f23e68bf6e769d8a96e40a2b0c4426e38507 (patch)
tree60024b9d191aff4dd21d5f3489c786088a07f52c /dhall/tests
parent48d89a280838919c1fba9e0acf1e090d3286c470 (diff)
Add parser/failure tests from spec
Diffstat (limited to 'dhall/tests')
-rw-r--r--dhall/tests/macros.rs8
-rw-r--r--dhall/tests/tests.rs10
2 files changed, 17 insertions, 1 deletions
diff --git a/dhall/tests/macros.rs b/dhall/tests/macros.rs
index 5ad2ab3..6031a34 100644
--- a/dhall/tests/macros.rs
+++ b/dhall/tests/macros.rs
@@ -18,7 +18,13 @@ macro_rules! run_spec_test {
};
(parser, $path:expr) => {
let expr_str = include_test_str!(concat!($path, "A"));
- parser::parse_expr(&expr_str).unwrap();
+ parser::parse_expr_pest(&expr_str).map_err(|e| println!("{}", e)).unwrap();
+ // parser::parse_expr(&expr_str).unwrap();
+ };
+ (parser_failure, $path:expr) => {
+ let expr_str = include_test_str!($path);
+ parser::parse_expr_pest(&expr_str).map_err(|e| println!("{}", e)).unwrap_err();
+ // parser::parse_expr(&expr_str).unwrap();
};
}
diff --git a/dhall/tests/tests.rs b/dhall/tests/tests.rs
index 6a2ada8..0e097b2 100644
--- a/dhall/tests/tests.rs
+++ b/dhall/tests/tests.rs
@@ -211,3 +211,13 @@ make_spec_test!(parser, spec_parser_success_union, "parser/success/union");
make_spec_test!(parser, spec_parser_success_urls, "parser/success/urls");
make_spec_test!(parser, spec_parser_success_whitespace, "parser/success/whitespace");
make_spec_test!(parser, spec_parser_success_whitespaceBuffet, "parser/success/whitespaceBuffet");
+
+make_spec_test!(parser_failure, spec_parser_failure_annotation, "parser/failure/annotation");
+// make_spec_test!(parser_failure, spec_parser_failure_doubleBoundsNeg, "parser/failure/doubleBoundsNeg");
+// make_spec_test!(parser_failure, spec_parser_failure_doubleBoundsPos, "parser/failure/doubleBoundsPos");
+make_spec_test!(parser_failure, spec_parser_failure_importAccess, "parser/failure/importAccess");
+make_spec_test!(parser_failure, spec_parser_failure_incompleteIf, "parser/failure/incompleteIf");
+make_spec_test!(parser_failure, spec_parser_failure_mandatoryNewline, "parser/failure/mandatoryNewline");
+make_spec_test!(parser_failure, spec_parser_failure_missingSpace, "parser/failure/missingSpace");
+make_spec_test!(parser_failure, spec_parser_failure_spaceAfterListAppend, "parser/failure/spaceAfterListAppend");
+// make_spec_test!(parser_failure, spec_parser_failure_boundBuiltin, "parser/failure/boundBuiltin");