@@ -33,13 +33,29 @@ def test_format_triggers(self):
3333 def test_check_syntax (self ):
3434 mismatch_brackets = ["a (b" , "a [b" , "a {b" , "a <b" , "a b)" , "a b]" , "a b}" , "a b>" ]
3535 empty_pipes = ["[a|b| ]" , "[a|b|]" , "[a| |c]" , "[a||c]" , "[ |b|c]" , "[|b|c]" ]
36+ advanced_brackets = [") a (" , "] b [" , "> c <" , "} d {" , "a (b [c) d]" , "a (b [c|d] e)" ]
37+ angle_brackets = ["(a <b) c>" , "<a (b > c)" , "[a <b ] c>" , "< a [b > c]" , "{ a < b } c >" , "< a {b > c }" ]
38+ pipe_outside = ["a|b" , "a|" , "|b" , "(a|b) | (c|d)" , "(a|b)|(c|d)" ]
3639
37- for failing_trigger in mismatch_brackets + empty_pipes :
40+ for failing_trigger in mismatch_brackets + empty_pipes + advanced_brackets + pipe_outside + angle_brackets :
3841 self .assertRaises (Exception , self .new , """
3942 + {}
4043 - hi
4144 """ .format (failing_trigger ))
4245
46+ self .new ("""
47+ ! version = 2.0
48+
49+ // Bot variables
50+ ! var name = Tutorial
51+ ! var nickname = tut
52+
53+ + [<bot name>|<nickname>] *
54+ - You called?
55+ """ )
56+ self .reply ("Tutorial" , "You called?" )
57+ self .reply ("tut" , "You called?" )
58+
4359 def test_invalid_character_raise_exception (self ):
4460 self .assertRaises (Exception , self .new , """
4561 + $hello
0 commit comments