def test_scan_incomplete(): with pytest.raises(ValueError): scan([dollar], '$1')
def test_scan(): assert scan([dollar], '$') == [Node(dollar, '$')] assert scan([dollar, number], '$123') == [ Node(dollar, '$'), Node(number, '123'), ]