-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add new [%%expect_in <version-range> {| ... |}]
syntax for expect tests and fix 5.3 builds
#539
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f16d074
Add versioned expect block to expect test runner
NathanReb f5febf3
Make new [%%expect_in syntax compatible with ocamlformat
NathanReb d68e6bf
Make expect test runner compatible with 5.3+ again
NathanReb 9cb1df4
Use [%%expect_in to make test pass under 5.3
NathanReb 5444b6e
Add support for single version [%%expect_in]
NathanReb fb3c5bf
Add [%%ignore] to expect_test runner and fix quoter tests
NathanReb cbfb6f3
Bring expect_in version ranges in line with opam notations
NathanReb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
val split_file : | ||
file_contents:string -> Lexing.lexbuf -> (Lexing.position * string) list | ||
type version = int * int | ||
|
||
type version_range = | ||
| Only of version | ||
| Up_to of version | ||
| From of version | ||
| Between of version * version | ||
|
||
(*[[%%ignore]], [[%%expect{|...|}] or [%%expect_in 5.3 {|...|}]*) | ||
type expect_block = | ||
| Ignore | ||
| Regular | ||
| Versioned of (version_range * string) list | ||
|
||
type chunk = { | ||
phrases : string; | ||
phrases_start : Lexing.position; | ||
expect : expect_block; | ||
} | ||
|
||
val split_file : file_contents:string -> Lexing.lexbuf -> chunk list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe a comment that the expectation is the combination of ranges should cover the ranges for which the test will be run against -- I had initially thought we would have some kind of implicit
ignore
if a version was not found.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.
Yeah that's a good point, I'll change that!
The idea for not ignoring the output for versions not covered by the union of ranges was that we should try and run our tests for all versions as much as possible and that tests that absolutely don't work on certain versions should probably not be run for those at all. This will force us to isolate such tests.