Exemplo n.º 1
0
 def test_peek_missing(self):
     """Test the peek method when the token does not exist."""
     parser = SimpleParser("Hello, World!")
     self.assertEqual(parser.peek("\d+"), "")
Exemplo n.º 2
0
 def test_peek_missing(self):
     """Test the peek method when the token does not exist."""
     parser = SimpleParser("Hello, World!")
     self.assertEqual(parser.peek("\d+"), "")
Exemplo n.º 3
0
 def test_peek_existing(self):
     """Test the peek method when the token exists."""
     parser = SimpleParser("Hello, World!")
     self.assertEqual(parser.peek("\w+"), "Hello")
Exemplo n.º 4
0
 def test_peek_existing(self):
     """Test the peek method when the token exists."""
     parser = SimpleParser("Hello, World!")
     self.assertEqual(parser.peek("\w+"), "Hello")