aboutsummaryrefslogtreecommitdiff
path: root/src/suites/flow.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/suites/flow.py')
-rw-r--r--src/suites/flow.py145
1 files changed, 59 insertions, 86 deletions
diff --git a/src/suites/flow.py b/src/suites/flow.py
index eac9459..a62cd9d 100644
--- a/src/suites/flow.py
+++ b/src/suites/flow.py
@@ -6,13 +6,13 @@
# By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/07/15 18:24:52 by charles #+# #+# #
-# Updated: 2020/10/08 16:45:19 by cacharle ### ########.fr #
+# Updated: 2020/10/08 17:33:32 by cacharle ### ########.fr #
# #
# ############################################################################ #
import config
from suite import suite
-from hooks import error_line0, platform_status, discard, replace_double_semi_colon
+from hooks import error_line0, platform_status, discard, replace_double_semi_colon, error_eof_to_expected_token
@suite()
@@ -208,27 +208,23 @@ def suite_parenthesis(test):
@suite()
def suite_syntax_error(test):
""" separator syntax error test """
- test("< |", hook=error_line0)
- test("> |", hook=error_line0)
- test(">> |", hook=error_line0)
- test("< ;", hook=error_line0)
- test("> ;", hook=error_line0)
- test(">> ;", hook=error_line0)
- test("; |", hook=error_line0)
- test("; |", hook=error_line0)
- test("; |", hook=error_line0)
- test("; <", hook=error_line0)
- test("; >", hook=error_line0)
- test("; >>", hook=error_line0)
- test("| ;", hook=error_line0)
- test("| ;", hook=error_line0)
- test("| ;", hook=error_line0)
- test("| <", hook=error_line0)
- test("| >", hook=error_line0)
- test("| >>", hook=error_line0)
- test("> a ;", hook=error_line0)
- test("< a ;", hook=error_line0)
- test(">> a ;", hook=error_line0)
+ test("< | a", hook=error_line0)
+ test("> | a", hook=error_line0)
+ test(">> | a", hook=error_line0)
+ test("< ; a", hook=error_line0)
+ test("> ; a", hook=error_line0)
+ test(">> ; a", hook=error_line0)
+ test("; | a", hook=error_line0)
+ test("; < a", hook=error_line0)
+ test("; > a", hook=error_line0)
+ test("; >> a", hook=error_line0)
+ test("| ; a", hook=error_line0)
+ test("| < a", hook=error_line0)
+ test("| > a", hook=error_line0)
+ test("| >> a", hook=error_line0)
+ test("> a ; a", hook=error_line0)
+ test("< a ; a", hook=error_line0)
+ test(">> a ; a", hook=error_line0)
test(config.LOREM + " > >" + config.LOREM, hook=error_line0)
test(config.LOREM + " < <" + config.LOREM, hook=error_line0)
test(config.LOREM + " ; |" + config.LOREM, hook=error_line0)
@@ -238,70 +234,47 @@ def suite_syntax_error(test):
@suite(bonus=True)
def suite_syntax_error_bonus(test):
""" separator syntax error bonus test """
- test("< &&", hook=error_line0)
- test("> &&", hook=error_line0)
- test(">> &&", hook=error_line0)
- test("< ||", hook=error_line0)
- test("> ||", hook=error_line0)
- test(">> ||", hook=error_line0)
- test("< (", hook=error_line0)
- test("> (", hook=error_line0)
- test(">> (", hook=error_line0)
- test("< )", hook=error_line0)
- test("> )", hook=error_line0)
- test(">> )", hook=error_line0)
- test("&& <", hook=error_line0)
- test("&& >", hook=error_line0)
- test("&& >>", hook=error_line0)
- test("&& ||", hook=error_line0)
- test("&& ||", hook=error_line0)
- test("&& ||", hook=error_line0)
- test("&& (", hook=error_line0)
- test("&& (", hook=error_line0)
- test("&& (", hook=error_line0)
- test("&& )", hook=error_line0)
- test("&& )", hook=error_line0)
- test("&& )", hook=error_line0)
- test("|| <", hook=error_line0)
- test("|| >", hook=error_line0)
- test("|| >>", hook=error_line0)
- test("|| &&", hook=error_line0)
- test("|| &&", hook=error_line0)
- test("|| &&", hook=error_line0)
- test("|| (", hook=error_line0)
- test("|| (", hook=error_line0)
- test("|| (", hook=error_line0)
- test("|| )", hook=error_line0)
- test("|| )", hook=error_line0)
- test("|| )", hook=error_line0)
- test("( <", hook=error_line0)
- test("( >", hook=error_line0)
- test("( >>", hook=error_line0)
- test("( &&", hook=error_line0)
- test("( &&", hook=error_line0)
- test("( &&", hook=error_line0)
- test("( ||", hook=error_line0)
- test("( ||", hook=error_line0)
- test("( ||", hook=error_line0)
- test("( )", hook=error_line0)
- test("( )", hook=error_line0)
- test("( )", hook=error_line0)
- test(") <", hook=error_line0)
- test(") >", hook=error_line0)
- test(") >>", hook=error_line0)
- test(") &&", hook=error_line0)
- test(") &&", hook=error_line0)
- test(") &&", hook=error_line0)
- test(") ||", hook=error_line0)
- test(") ||", hook=error_line0)
- test(") ||", hook=error_line0)
- test(") (", hook=error_line0)
- test(") (", hook=error_line0)
- test(") (", hook=error_line0)
- test("()", hook=error_line0)
- test("(", hook=[error_line0, lambda o: o.replace("-c: line 1: ", "")])
- test(")", hook=error_line0)
+ test("< && a", hook=error_line0)
+ test("> && a", hook=error_line0)
+ test(">> && a", hook=error_line0)
+ test("< || a", hook=error_line0)
+ test("> || a", hook=error_line0)
+ test(">> || a", hook=error_line0)
+ test("< ( a", hook=error_line0)
+ test("> ( a", hook=error_line0)
+ test(">> ( a", hook=error_line0)
+ test("< ) a", hook=error_line0)
+ test("> ) a", hook=error_line0)
+ test(">> ) a", hook=error_line0)
+ test("&& < a", hook=error_line0)
+ test("&& > a", hook=error_line0)
+ test("&& >> a", hook=error_line0)
+ test("&& || a", hook=error_line0)
+ test("&& ( a", hook=error_line0)
+ test("&& ) a", hook=error_line0)
+ test("|| < a", hook=error_line0)
+ test("|| > a", hook=error_line0)
+ test("|| >> a", hook=error_line0)
+ test("|| && a", hook=error_line0)
+ test("|| ( a", hook=error_line0)
+ test("|| ) a", hook=error_line0)
+ test("( < a", hook=[error_line0, error_eof_to_expected_token])
+ test("( > a", hook=[error_line0, error_eof_to_expected_token])
+ test("( >> a", hook=[error_line0, error_eof_to_expected_token])
+ test(") < a", hook=error_line0)
+ test(") > a", hook=error_line0)
+ test(") >> a", hook=error_line0)
+ test("( && a", hook=error_line0)
+ test("( || a", hook=error_line0)
+ test("( ) a", hook=error_line0)
+ test(") && a", hook=error_line0)
+ test(") || a", hook=error_line0)
+ test(") ( a", hook=error_line0)
+ test("() a", hook=error_line0)
+ test("( a", hook=[error_line0, error_eof_to_expected_token])
+ test(") a", hook=error_line0)
test(config.LOREM + " && &&" + config.LOREM, hook=error_line0)
test(config.LOREM + " || ||" + config.LOREM, hook=error_line0)
test(config.LOREM + " ( (" + config.LOREM, hook=error_line0)
test(config.LOREM + " ) )" + config.LOREM, hook=error_line0)
+ test("(); () ;() ;() ;() ;() ;() ;() ;() ;() ;a", hook=error_line0)