aboutsummaryrefslogtreecommitdiff
path: root/test/nested_string.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/nested_string.ml')
-rw-r--r--test/nested_string.ml33
1 files changed, 20 insertions, 13 deletions
diff --git a/test/nested_string.ml b/test/nested_string.ml
index b121667..3338fa3 100644
--- a/test/nested_string.ml
+++ b/test/nested_string.ml
@@ -5,23 +5,30 @@ let _position = (Lexing.dummy_pos, Lexing.dummy_pos)
let _test_instruction : string -> Qsp_syntax.Report.t list -> unit =
Check._test_instruction
-let nothing () = _test_instruction {|
-"value = <<$variable>>"
- |} []
+let report =
+ [
+ {
+ Qsp_syntax.Report.level = Debug;
+ Qsp_syntax.Report.loc = _position;
+ Qsp_syntax.Report.message = "This expression can be simplified";
+ };
+ ]
-let simple_expression () =
- _test_instruction {|"<<$variable>>"|}
- [
- {
- level = Debug;
- loc = _position;
- message = "This expression can be simplified";
- };
- ]
+let nothing () = _test_instruction {|"value = <<$variable>>"|} []
+let string () = _test_instruction {|"<<'ABC'>>"|} report
+let string_variable () = _test_instruction {|"<<$variable>>"|} report
+
+(** It’s OK to use this system to convert a numeric value into a string *)
+let integer () = _test_instruction {|"<<123>>"|} []
+
+let integer_variable () = _test_instruction {|"<<variable>>"|} []
let test =
( "Nested_strings checker",
[
Alcotest.test_case "Ok" `Quick nothing;
- Alcotest.test_case "Simple expression" `Quick simple_expression;
+ Alcotest.test_case "String variable" `Quick string_variable;
+ Alcotest.test_case "Integer" `Quick integer;
+ Alcotest.test_case "String" `Quick string;
+ Alcotest.test_case "Integer variable" `Quick integer_variable;
] )