diff options
author | Chimrod <> | 2024-01-18 08:25:54 +0100 |
---|---|---|
committer | Chimrod <> | 2024-01-18 08:25:54 +0100 |
commit | c8fb3bdbf3d35c0fd4496d3150961e1fcb202f05 (patch) | |
tree | 27554b623d66d8c85eea16b59847973fda779460 /test/syntax.ml | |
parent | ed1365aedbc69eea0b9c8338d97ec096542e4c2a (diff) |
Change STATTXT into an identifier instead of a function
Diffstat (limited to 'test/syntax.ml')
-rw-r--r-- | test/syntax.ml | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/test/syntax.ml b/test/syntax.ml index f64129f..3b7c2f9 100644 --- a/test/syntax.ml +++ b/test/syntax.ml @@ -596,7 +596,7 @@ let test_if_inline_act () = let test_if_multiline () = _test_instruction {|if 1 _ - and hour >= 8: 1|} + and _hour >= 8: 1|} [ Ast.If { @@ -611,7 +611,7 @@ let test_if_multiline () = ( _position, Qsp_syntax.T.Gte, Ast.Ident - { Ast.pos = _position; name = "HOUR"; index = None }, + { Ast.pos = _position; name = "_HOUR"; index = None }, Ast.Integer (_position, "8") ) ), [ Tree.Ast.Expression (Tree.Ast.Integer (_position, "1")) ] ); elifs = []; @@ -884,6 +884,18 @@ let minus_operator () = Tree.Ast.Integer (_position, "7") )); ] +(** STATTXT was considered as a function and raised an error in the syntax *) +let test_stattxt () = + _test_instruction "$value = $stattxt" + [ + Tree.Ast.Declaration + ( _position, + { Tree.Ast.pos = _position; name = "$VALUE"; index = None }, + T.Eq', + Tree.Ast.Ident + { Tree.Ast.pos = _position; name = "$STATTXT"; index = None } ); + ] + let test = ( "Syntax", [ @@ -952,4 +964,5 @@ let test = Alcotest.test_case "inline if else if" `Quick test_mutiple_inline_ifs; Alcotest.test_case "Precedence7" `Quick test_precedence7; Alcotest.test_case "Precedence8" `Quick test_precedence8; + Alcotest.test_case "stattxt" `Quick test_stattxt; ] ) |