diff options
Diffstat (limited to 'src/suites/flow.py')
| -rw-r--r-- | src/suites/flow.py | 105 |
1 files changed, 104 insertions, 1 deletions
diff --git a/src/suites/flow.py b/src/suites/flow.py index bcee31e..eac9459 100644 --- a/src/suites/flow.py +++ b/src/suites/flow.py @@ -6,10 +6,11 @@ # By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 18:24:52 by charles #+# #+# # -# Updated: 2020/10/08 08:40:56 by cacharle ### ########.fr # +# Updated: 2020/10/08 16:45:19 by cacharle ### ########.fr # # # # ############################################################################ # +import config from suite import suite from hooks import error_line0, platform_status, discard, replace_double_semi_colon @@ -202,3 +203,105 @@ def suite_parenthesis(test): test("( echo salut && echo bonjours ) ; echo comment ca va") test("(cd /; echo $PWD; pwd); echo $PWD; pwd") test("(export A=a; echo $A); echo $A") + + +@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(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) + + +@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(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) |
