Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Moosems committed Jul 23, 2024
1 parent 1a9cd97 commit ff34b0b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
3 changes: 1 addition & 2 deletions albero/tree_sitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ def get_highlights(
tree, self.mappings[self.files[file_name][0]], self.logger
)
return_tokens = only_tokens_in_text_range(return_tokens, text_range)
# return return_tokens
return []
return return_tokens

def remove_file(self, file_name: str) -> None:
if file_name not in self.files:
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pip install -U -r requirements-dev.txt --break-system-packages; pip uninstall salve -y --break-system-packages; pip install . --break-system-packages --no-build-isolation; python3 -m pytest .
# pip install -U -r requirements-dev.txt --break-system-packages; pip uninstall albero -y --break-system-packages; pip install . --break-system-packages --no-build-isolation; python3 -m pytest .
from setuptools import setup

with open("README.md", "r") as file:
Expand All @@ -25,7 +25,5 @@
"License :: OSI Approved :: MIT License",
"Typing :: Typed",
],
packages=[
"albero",
],
packages=["albero", "albero.languages"],
)
14 changes: 12 additions & 2 deletions tests/test_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ def test_basic_usage():
"test"
) # Trying to use a file not in the system gives an AlberoException

assert tokens == []
assert tokens == [
((1, 0), 3, "Keyword"),
((1, 4), 4, "Name"),
((1, 8), 3, "Punctuation"),
((1, 12), 3, "Operator"),
]


def test_file_removal():
Expand All @@ -44,7 +49,12 @@ def test_file_removal():
"python"
) # Can be done first but it will already auto-close any files that use it

assert tokens == []
assert tokens == [
((1, 0), 3, "Keyword"),
((1, 4), 4, "Name"),
((1, 8), 3, "Punctuation"),
((1, 12), 3, "Operator"),
]


def test_mapping_update():
Expand Down

0 comments on commit ff34b0b

Please sign in to comment.