From 73e7e0ca6b7b7a0676300d7900c743defe41fa10 Mon Sep 17 00:00:00 2001
From: Chimrod <>
Date: Thu, 19 Oct 2023 09:51:16 +0200
Subject: Updated the tests

---
 test/syntax_error.ml | 42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

(limited to 'test')

diff --git a/test/syntax_error.ml b/test/syntax_error.ml
index 6c28f0f..08de384 100644
--- a/test/syntax_error.ml
+++ b/test/syntax_error.ml
@@ -116,7 +116,46 @@ let inline_elif () =
     {
       level = Error;
       loc = _position;
-      message = "Mix between IF block and inline ELIF";
+      message = "Mix between `IF` block and inline `ELIF`";
+    }
+
+let unclosed_block () =
+  _test_instruction {|
+if $ARGS[0] = 'arg':
+	act'action':
+end|}
+    {
+      level = Error;
+      loc = _position;
+      message =
+        "Unclosed `IF` block. Another block ends before the `END` instruction.";
+    };
+
+  _test_instruction
+    {|
+IF 1:
+ELSE
+    0
+      |}
+    {
+      level = Error;
+      loc = _position;
+      message =
+        "Unclosed `ELSE` block. Another block ends before the `END` \
+         instruction.";
+    };
+  _test_instruction
+    {|
+IF 1:
+ELSEIF 0:
+    0
+      |}
+    {
+      level = Error;
+      loc = _position;
+      message =
+        "Unclosed `ELIF` block. Another block ends before the `END` \
+         instruction.";
     }
 
 let test =
@@ -132,4 +171,5 @@ let test =
       Alcotest.test_case "Missing operand" `Quick missing_operand;
       Alcotest.test_case "Unknown function" `Quick unknow_function;
       Alcotest.test_case "Inline elif" `Quick inline_elif;
+      Alcotest.test_case "Unclosed block" `Quick unclosed_block;
     ] )
-- 
cgit v1.2.3