Skip to content

Instantly share code, notes, and snippets.

@lambdaofgod
Created January 29, 2023 13:04
Show Gist options
  • Save lambdaofgod/7c9738c483d9265232fca4dbab2978d4 to your computer and use it in GitHub Desktop.
Save lambdaofgod/7c9738c483d9265232fca4dbab2978d4 to your computer and use it in GitHub Desktop.
Test Rust tokenization
from rust_functions import tokenize_python_code
def test_simple_input():
example_code = """
def foo():
return x + 1
"""
expected_tokens = ["def", "foo", "(", ")", "return", "x", "+", "1"]
assert tokenize_rust(example_code.strip()) == expected_tokens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment