-
Notifications
You must be signed in to change notification settings - Fork 56
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
fix #190: refactor parser tests into separate modules #194
Conversation
Thank you for the fix! Could you please rebase this on the parser_recovery branch, or wait until that branch is submitted? |
Codecov Report
@@ Coverage Diff @@
## master #194 +/- ##
=======================================
Coverage 95.54% 95.54%
=======================================
Files 47 55 +8
Lines 21037 20997 -40
=======================================
- Hits 20099 20062 -37
+ Misses 938 935 -3
Continue to review full report at Codecov.
|
cool thx, looks really good there was a bit of an unlucky timing, i had a pretty big commit pending for quite some time ... I just looked at the conflicts locally and its really not that bad. you need to just apply the (real) changes form parser_tests.rs to where you moved the test. Its not that bad, it looks more intimidating than it is. |
77550fa
to
c57afa8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I noticed that some of the tests are not in the correct place. I think for the most part you would be able to move the entire module one directory up, but for some, you might still have to split them into modules.
use pretty_assertions::*; | ||
|
||
#[test] | ||
fn simple_foo_function_can_be_parsed() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the tests in this file are error tests, I think this module can move below the parser module instead of the parse_errors one
use crate::parser::{parse, tests::lex}; | ||
|
||
#[test] | ||
fn initial_scalar_values_can_be_parsed() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue here, these are not error tests
msg | ||
); | ||
} else { | ||
panic!("Expected parse error but didn't get one."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try : assert_eq!(Err(Diagnostic...,parse_result)? Maybe that removes the coverage warning.
}; | ||
|
||
#[test] | ||
fn simple_foo_program_can_be_parsed() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also no error test
@@ -970,3 +970,281 @@ fn test_case_without_condition() { | |||
),] | |||
); | |||
} | |||
|
|||
#[test] | |||
fn empty_statements_are_are_parsed() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these tests are not error related either
use pretty_assertions::*; | ||
|
||
#[test] | ||
fn simple_struct_type_can_be_parsed() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non error tests
} | ||
|
||
#[test] | ||
fn two_global_vars_can_be_parsed() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non error tests
Thanks for the comments, this should now be resolved. |
parser/tests/parser_test.rs
split up into multiple separate modules inparser/tests
as well asparser/tests/parse_errors