Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDFLib: complete the terminal/combinator parsers for turtle grammar and have them all tested #14

Closed
2 tasks done
tian3rd opened this issue Dec 4, 2022 · 8 comments
Closed
2 tasks done
Assignees

Comments

@tian3rd
Copy link
Contributor

tian3rd commented Dec 4, 2022

The next step is to integrate the parsers into the more flexible GrammarDefinition classes, and interpret them into triples, prefix namespaces, and finally save all the information in the Graph. Will create another issue for this next step.

@tian3rd tian3rd self-assigned this Dec 4, 2022
@tian3rd
Copy link
Contributor Author

tian3rd commented Dec 18, 2022

Update:

Have half of the rules tested in the test files. Will finish the rest rules and test cases today.

@tian3rd
Copy link
Contributor Author

tian3rd commented Dec 20, 2022

Update:

Have all the grammar rules tested, and refactored in the test folder. Check https://github.com/anusii/rdflib/tree/main/test/parser/single_grammar for more details.

Have finished the two tasks in closing criteria.

@gjwgit
Copy link
Contributor

gjwgit commented Dec 20, 2022

Thanks @tian3rd. How do I run the test suite?

@tian3rd
Copy link
Contributor Author

tian3rd commented Dec 21, 2022

Thanks @tian3rd. How do I run the test suite?

Hi @gjwgit you can test it with dart test in the project root folder.

Or if you just want to test one single file, dart test test/parser/single_grammar/\[4\]prefixID_test.dart for example

Right now, for quickly verifying the issues, I still use print in the dart test files so I can see the output in the command line.

@tian3rd
Copy link
Contributor Author

tian3rd commented Dec 22, 2022

Found a way to test the code coverage for the tests (https://pub.dev/packages/test#collecting-code-coverage):

## Run Dart tests and output them at directory `./coverage`:
dart run test --coverage=./coverage

## Activate package `coverage` (if needed):
dart pub global activate coverage

## Format collected coverage to LCOV (only for directory "lib")
dart pub global run coverage:format_coverage --packages=.dart_tool/package_config.json --report-on=lib --lcov -o ./coverage/lcov.info -i ./coverage

## Generate LCOV report:
genhtml -o ./coverage/report ./coverage/lcov.info

## Open the HTML coverage report:
open ./coverage/report/index.html

@tian3rd
Copy link
Contributor Author

tian3rd commented Dec 22, 2022

Since the petitparser package is mainly used for the parsing, there's few customized functions or methods to be tested, so this coverage report only offers limited view of code coverage. But I plan to write tests for the Graph, Triple and other classes, so there will be more customized functions to give more details in the report.

Current coverage report:

Image

@gjwgit
Copy link
Contributor

gjwgit commented Dec 23, 2022

$ dart test

[...]

00:03 +725: All tests passed!                                                                                                                                              
$ dart run test --coverage=./coverage

[...]

00:32 +725: All tests passed!

... so we can close this now? Thanks.

@tian3rd
Copy link
Contributor Author

tian3rd commented Dec 23, 2022

Yes, it can be closed @gjwgit

@gjwgit gjwgit closed this as completed Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants