-
Couldn't load subscription status.
- Fork 247
[CK_BUILDER] Add inline string diff for tests #3067
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
Conversation
c3fe4ef to
18e8161
Compare
f6dffc6 to
c7d3403
Compare
| #include <ck/utility/sequence.hpp> | ||
|
|
||
| namespace ck_tile::builder { | ||
|
|
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.
It’s not clear to me why we are including this file in this PR. I don’t think we’re using any of it for inline_diff.
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.
Removed it
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.
No, I didn't mean the include. Why are we adding the file builder_utils.h in this PR?
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.
It's being included by test_builder_utils.cpp, which is using to_sequence_v, among others
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.
Removed it, see comment below
| EXPECT_TRUE((std::is_same_v<result_seq, expected_seq>)); | ||
| } | ||
|
|
||
| TEST(BuilderUtils, StringLiteral) |
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.
Why is this test called BuilderUtils - StringLiteral? This is not what the test is. It shouldn't go in the file test_builder_utils.hpp, either.
The only files should be testing_utils.hpp, testing_utils.cpp, and the test for them, test_testing_utils.cpp. Builder utils don't belong here.
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.
Actually, it looks like my might not have pushed the latest changes you have. Your comments look like they may be ahead of the code in this PR.
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.
I think I just realized what happened here... I was looking at the diff vs. the branch you were pointing me to, and there was a test where strings were being compared. I assumed that was supposed to be the test for the inlineDiff function, and worked from there. But apparently this was the test for the builder_utils StringLiteral feature. That also explains the dependency on builder_utils from the two other tests in the comment above
…d builder_uitls, added non-color tests
5e7c9d4 to
9e744d5
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.
Thanks, looks great!
Adds new testing functionality: an inline diff for string comparison.
Example usage:
EXPECT_THAT("Actual string", ck_tile::test::StringEqWithDiff("Expected string"));
Failure message:
Value of: "Actual string"
Expected: "Expected string"
Actual: "Actual string" (of type char [14]),
Diff: "[Expe|A]ct[ed|ual] string"
The inline-diff function uses the Wagner-Fischer algorithm to find the minimum edit distance and generate diff markers, which has O(N^2) complexity. It has optional color codes that are enabled with the matcher.
This PR adds new testing functionality: an inline diff for string comparison.
Example usage:
EXPECT_THAT("Actual string", ck_tile::test::StringEqWithDiff("Expected string"));
Failure message:
Value of: "Actual string"
Expected: "Expected string"
Actual: "Actual string" (of type char [14]),
Diff: "[Expe|A]ct[ed|ual] string"
The inline-diff function uses the Wagner-Fischer algorithm to find the minimum edit distance and generate diff markers, which has O(N^2) complexity. It has optional color codes that are enabled with the matcher.