aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/literals.ml18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/literals.ml b/test/literals.ml
index 90741ff..f98fa8f 100644
--- a/test/literals.ml
+++ b/test/literals.ml
@@ -47,7 +47,7 @@ let comment2 () =
_test_instruction {|!'text <<expr>>'|} [ Tree.Ast.Comment _position ]
(** A single quote inside a string does not mean we are starting nested string
- *)
+*)
let direct_text () =
_test_instruction {|"don't"|}
[ Tree.Ast.Expression (Tree.Ast.Literal (_position, [ T.Text "don't" ])) ];
@@ -92,6 +92,21 @@ let expression () =
] ));
]
+let multiple_expression () =
+ _test_instruction {|"'<<expr1>>'<<$expr2>>"|}
+ [
+ Tree.Ast.Expression
+ (Tree.Ast.Literal
+ ( _position,
+ [
+ T.Text "'<<expr1>>'";
+ T.Expression
+ (Tree.Ast.Ident
+ { Tree.Ast.pos = _position; name = "$EXPR2"; index = None });
+ T.Text "";
+ ] ));
+ ]
+
let test =
( "Literals",
[
@@ -111,4 +126,5 @@ let test =
Alcotest.test_case "Quote in string" `Quick direct_text;
Alcotest.test_case "elements_sequence" `Quick elements_sequence;
Alcotest.test_case "expression" `Quick expression;
+ Alcotest.test_case "multiple_expression" `Quick multiple_expression;
] )