Skip to content

Commit

Permalink
Add another test
Browse files Browse the repository at this point in the history
  • Loading branch information
klntsky committed Nov 8, 2024
1 parent a204204 commit fc523d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions python/metaprompt/parse_metaprompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def extract_tokens(input_text):
input_stream = InputStream(input_text)
lexer = MetaPromptLexer(input_stream)
token_stream = CommonTokenStream(lexer)
token_stream.fill() # Fetches all tokens at once
token_stream.fill()
tokens = []
for token in token_stream.tokens:
token_name = (
Expand All @@ -138,7 +138,6 @@ def extract_tokens(input_text):


def parse_metaprompt(prompt):
print(extract_tokens(prompt))
stream = InputStream(prompt)
lexer = MetaPromptLexer(stream)
stream = CommonTokenStream(lexer)
Expand Down
6 changes: 3 additions & 3 deletions python/metaprompt/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ def test_dummy_meta3():
assert result["exprs"] == [t("["), t("a")]


# def test_dummy_meta2():
# result = parse_metaprompt("[[][]]")
# assert result["exprs"] == [t("[[][]]")]
def test_dummy_meta2():
result = parse_metaprompt("[[][]]")
assert result["exprs"] == [t("["), t("["), t("]"), t("["), t("]"), t("]")]

0 comments on commit fc523d9

Please sign in to comment.