From 706e2132e443ed422912264f0401ee607d1d2ef5 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Mon, 23 Dec 2024 16:39:22 +0100 Subject: Found a bug in the string interpretation --- test/literals.ml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'test') 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 <>'|} [ 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 {|"'<>'<<$expr2>>"|} + [ + Tree.Ast.Expression + (Tree.Ast.Literal + ( _position, + [ + T.Text "'<>'"; + 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; ] ) -- cgit v1.2.3