-
-
Notifications
You must be signed in to change notification settings - Fork 455
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
test: add snapshot tests for MessageBuilder #5598
Conversation
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.
clang-tidy made some suggestions
AppleClang doesn't like the ctor
They might need to run in parallel in CI...
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.
Partial review, haven't taken a full look
Overall looks good and will definitely bring confidence in changing the MessageBuilder logic going forward
this has some issues with CTest when adding files but is mostly fine
I want to refactor the
MessageBuilder
for IRC messages, but it's an integral part of Chatterino, so I'm adding some tests first. These test that the output message is the same. Adding tests requires the following steps (also documented in theMessageBuilder
test (at the top).tests/snapshots/MessageBuilder/IRC
as a new JSON file ({ "input": "<IRC-msg>" }
) and save itUPDATE_SNAPSHOTS
intests/src/MessageBuilder.cpp
totrue
IRC_SNAPSHOTS
ctest -R TestMessageBuilderP --output-on-failure
). Don't worry about the integrity test for now.UPDATE_SNAPSHOTS
back tofalse
ctest -R TestMessageBuilderP --output-on-failure
(everything should pass now).On Windows, you might see that all snapshot files will show as modified. However, after staging them (
git add
), they shouldn't show up as modified anymore (as just the line-endings changed).Coverage from this PR: https://app.codecov.io/github/Chatterino/chatterino2/pull/5598