aboutsummaryrefslogtreecommitdiff
path: root/test/nested_string.ml
diff options
context:
space:
mode:
authorChimrod <>2023-11-02 17:35:49 +0100
committerChimrod <>2023-11-02 19:39:33 +0100
commitfd02a44392304986a756e7d06f8142538b386529 (patch)
tree87fe05ab02eecee8b2c8cc89ed5fa2c8b83d9771 /test/nested_string.ml
parent05f74bee05c0c56da593a5e89069711d5993e3b1 (diff)
Added a new checkers for unecessary use of strig containing an escaped expression
Diffstat (limited to 'test/nested_string.ml')
-rw-r--r--test/nested_string.ml27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/nested_string.ml b/test/nested_string.ml
new file mode 100644
index 0000000..b121667
--- /dev/null
+++ b/test/nested_string.ml
@@ -0,0 +1,27 @@
+module Check = Make_checkTest.M (Qsp_syntax.Nested_strings)
+
+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 simple_expression () =
+ _test_instruction {|"<<$variable>>"|}
+ [
+ {
+ level = Debug;
+ loc = _position;
+ message = "This expression can be simplified";
+ };
+ ]
+
+let test =
+ ( "Nested_strings checker",
+ [
+ Alcotest.test_case "Ok" `Quick nothing;
+ Alcotest.test_case "Simple expression" `Quick simple_expression;
+ ] )