Exemplo n.º 1
0
 def test_parse_check_delimiters_with_custom_delim(self):
     parser = StrCalculatorParser()
     result = parser.parse(";\n1;2").delimiters
     self.assertEqual(result, ";")
Exemplo n.º 2
0
 def test_parse_check_numbers_with_default_delim(self):
     parser = StrCalculatorParser()
     result = parser.parse("1,2").numbers
     self.assertEqual(result, [1, 2])
Exemplo n.º 3
0
 def test_parse_check_delimiters_with_default_delim(self):
     parser = StrCalculatorParser()
     result = parser.parse("1,2").delimiters
     self.assertEqual(result, ["\n", ","])
Exemplo n.º 4
0
 def test_parse_check_string_with_default_delim(self):
     parser = StrCalculatorParser()
     result = parser.parse("1,2").string
     self.assertEqual(result, "1,2")
Exemplo n.º 5
0
 def test_can_create_parser(self):
     parser = StrCalculatorParser()
     self.assertTrue(isinstance(parser, StrCalculatorParser))
Exemplo n.º 6
0
 def test_parse_check_numstring_with_custom_delim(self):
     parser = StrCalculatorParser()
     result = parser.parse(";\n1;2").numstring
     self.assertEqual(result, "1,2")