From a9142840fd9c3e1f8b841c30c81cac02c1f1bfa4 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sun, 17 Jun 2018 12:49:08 +0700 Subject: [PATCH] Add tests for % and $ chars in atoms Signed-off-by: Rudi Grinberg --- test/unit-tests/sexp.mlt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/unit-tests/sexp.mlt b/test/unit-tests/sexp.mlt index 2fb9aeaf..77a4f2a0 100644 --- a/test/unit-tests/sexp.mlt +++ b/test/unit-tests/sexp.mlt @@ -107,3 +107,33 @@ parse {|"\%{x}"|} - : parse_result = Different {jbuild = Ok ["\\%{x}"]; dune = Error "unknown escape sequence"} |}] + +parse {|"$foo"|} +[%%expect{| +- : parse_result = Same (Ok ["$foo"]) +|}] + +parse {|"%foo"|} +[%%expect{| +- : parse_result = Same (Ok ["%foo"]) +|}] + +parse {|"bar%foo"|} +[%%expect{| +- : parse_result = Same (Ok ["bar%foo"]) +|}] + +parse {|"bar$foo"|} +[%%expect{| +- : parse_result = Same (Ok ["bar$foo"]) +|}] + +parse {|"%bar$foo%"|} +[%%expect{| +- : parse_result = Same (Ok ["%bar$foo%"]) +|}] + +parse {|"$bar%foo%"|} +[%%expect{| +- : parse_result = Same (Ok ["$bar%foo%"]) +|}]