Exemple #1
0
from string_parser import StringParser

if __name__ == '__main__':
    parser = StringParser(debug_print=False)
    print(parser.check_string('{a=b>c;d=c<d}'))
    print(parser.check_string('{a=b+d>c-d;d=b+a<d-d}'))
    print(parser.check_string('{a=a*b>c}'))
    print(parser.check_string('{a=2=3}}'))
    print(parser.check_string('{a=2=3'))
Exemple #2
0
 def test_str_true(self):
     parser = StringParser()
     test_string = '{a=c>b}'
     result = parser.check_string(test_string)
     self.assertEqual(result, True)
Exemple #3
0
 def test_str_complex_true(self):
     parser = StringParser()
     test_string = '{a=b*b+3>c-d;d=5+a<4-d}'
     result = parser.check_string(test_string)
     self.assertEqual(result, True)
Exemple #4
0
 def test_str_false(self):
     parser = StringParser()
     test_string = '{a>b}'
     result = parser.check_string(test_string)
     self.assertEqual(result, False)
Exemple #5
0
 def test_str_couple_true(self):
     parser = StringParser()
     test_string = '{a=b>c;d=c<d}'
     result = parser.check_string(test_string)
     self.assertEqual(result, True)