DeanLight / spannerlib

https://deanlight.github.io/spannerlib/
Apache License 2.0
4 stars 1 forks source link

Add tests #115

Closed asmaamagdoub closed 1 year ago

asmaamagdoub commented 1 year ago

In this PR, we have added unit tests and e2e tests under nbs/tests/ . There are two test files, 'test_corenlp' and 'test_regex,' that are currently not working due to issues with the 'nlp' and 'rust_spanner_regex'. For now, we have temporarily deactivated these tests. and we are working on fixing these issues. Also, we have made some changes:

  1. Corrected assumptions about span_start and span_end: Previously, we assumed 0 <= span_start < span_end, but this assumption was incorrect.

  2. Changed some file paths: As the tests now run under nbs/tests/, we had to adjust paths to certain files. These changes include the paths to the stanford-corenlp zip file and grammar.lark and the path to enum_spanner_regex folder in the following files: session, utils, nlp, and rust_spanner_regex.

For example, the new path to stanford-corenlp-4.1.0.zip will look like this:

current_dir = Path.cwd()
path_parts = current_dir.parts
if 'nbs' in current_dir.parts:
    index_of_nbs = current_dir.parts.index('nbs')
    current_dir = current_dir.joinpath(*path_parts[:index_of_nbs])
destination = Path(os.path.join(current_dir, 'spanner_workbench', 'rgxlog', 'stanford-corenlp-4.1.0.zip'))

instead of this

destination = Path(os.path.join(os.getcwd(), 'spanner_workbench', 'rgxlog', 'stanford-corenlp-4.1.0.zip'))
review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB