Closed tian3rd closed 1 year ago
Update:
Have half of the rules tested in the test files. Will finish the rest rules and test cases today.
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.
Thanks @tian3rd. How do I run the test suite?
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.
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
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:
$ 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.
Yes, it can be closed @gjwgit
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.