From 976f80ed226e53625cd807539b9336f52f6eb091 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Thu, 20 Jun 2024 20:25:19 +0200 Subject: Removed the need for () after rnd --- test/dup_cases.ml | 7 +++---- test/syntax.ml | 6 ++++++ 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/dup_cases.ml b/test/dup_cases.ml index 39bea23..cf1d4c1 100644 --- a/test/dup_cases.ml +++ b/test/dup_cases.ml @@ -20,11 +20,10 @@ end |} [] (** The rnd function can generate different result, this is not a warning *) -let ok_rnd () = - _test_instruction {| -if rnd(): +let ok_rnd () = _test_instruction {| +if rnd: 0 -elseif rnd(): +elseif rnd: 0 end |} [] diff --git a/test/syntax.ml b/test/syntax.ml index aa3eecb..f15c72f 100644 --- a/test/syntax.ml +++ b/test/syntax.ml @@ -707,6 +707,11 @@ let test_function2 () = [ Integer (_position, "0"); Integer (_position, "1") ] ))); ] +(** The RND function does not have parens after the name *) +let test_rnd () = + _test_instruction "rnd" + [ Tree.Ast.Expression (Tree.Ast.Function (_position, T.Rnd, [])) ] + let test_precedence4 () = _test_instruction "trim()" Ast.[ Expression (Function (_position, Trim, [])) ] @@ -934,6 +939,7 @@ let test = Alcotest.test_case "Call nl" `Quick test_nl; Alcotest.test_case "Function iif" `Quick test_function; Alcotest.test_case "Function rand" `Quick test_function2; + Alcotest.test_case "Function rnd" `Quick test_rnd; Alcotest.test_case "Precedence4" `Quick test_precedence4; Alcotest.test_case "Precedence5" `Quick test_precedence5; Alcotest.test_case "Precedence6" `Quick test_precedence6; -- cgit v1.2.3