def test_read_token_but_not_close_paren(self): test_string = list("akron)") index, token = SExpParser.read_token(test_string, 0) next_token = SExpParser.peek(test_string, index) self.assertEqual('akron', token, 'Token should equal "akron"') self.assertEqual(index, 5, 'index should advance') self.assertEqual(next_token, ')', 'next token should be ""')
def test_read_token_with_no_leading_whitespace(self): test_string = list("akron") index, token = SExpParser.read_token(test_string, 0) next_token = SExpParser.peek(test_string, index) self.assertEqual('akron', token, 'Token should equal "akron"') self.assertEqual(index, 5, 'index should advance') self.assertEqual(next_token, '', 'next token should be ""')