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

Simplify expect tests #470

Merged
merged 5 commits into from
Feb 8, 2024
Merged

Conversation

NathanReb
Copy link
Collaborator

It seems that in 5.1.0 the output of the toplevel was sometime prefixed with an empty line and that led us to have seperate expect test output reference files for 5.1.0.

This PR slightly modifies the expect test runner to trim the toplevel output, getting rid of said lines on the way.

There is also a small bonus: I'm suggesting a rewriting of one of the deriving test so it relies on a positive output of the toplevel rather than on error reporting from the compiler. I maybe lacking context but it seems to me the two test are equivalent and the updated one won't trigger a failure due to what appears to be a change in the error reporting in OCaml 5.2.

Please let me know what you think!

@NathanReb NathanReb added the no changelog Use this label to disable the changelog check github action label Feb 5, 2024
@NathanReb
Copy link
Collaborator Author

I should've opened this as draft, I wanted to see the CI run to test the 5.1.0 thing and make sure it was working alright!

@NathanReb
Copy link
Collaborator Author

It seems to be working fine! This should be ready to review!

@NathanReb
Copy link
Collaborator Author

There is something incredibly fishy going on here, even with the trimming we end up with a leading empty line in some cases. I'll look into it!

@NathanReb NathanReb force-pushed the simplify-deriving-test branch from 410c26c to 153e457 Compare February 5, 2024 15:35
@NathanReb
Copy link
Collaborator Author

NathanReb commented Feb 5, 2024

Got it, errors are reported by another printer, I'll try fixing this one as well!

@NathanReb NathanReb force-pushed the simplify-deriving-test branch from 153e457 to 117ee2c Compare February 7, 2024 11:02
@NathanReb
Copy link
Collaborator Author

Let's wait for the CI but I fixed the error reporting as well and manually tested it on 5.1.1 so it should be good this time.

Copy link
Collaborator

@panglesd panglesd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! The trimming removes many version-specific tests.

test/expect/expect_test.ml Outdated Show resolved Hide resolved
@NathanReb NathanReb merged commit 58b1476 into ocaml-ppx:main Feb 8, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Use this label to disable the changelog check github action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants