-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
gitutils: add diffStrings, diffFiles, and use it in testament to compare expected vs gotten #17892
Conversation
d2ec916
to
dc09c47
Compare
ed5bf24
to
13fdaab
Compare
We could revive |
PTAL
this can be done in future work and would be a 2 line fix once
Currently, a primary use case for |
@@ -307,7 +308,7 @@ proc addResult(r: var TResults, test: TTest, target: TTarget, | |||
maybeStyledEcho styleBright, expected, "\n" |
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.
showing expected
is still useful (even with showing the diff) so users can copy paste it
(and showing the given
is also useful for understanding the output)
…are expected vs gotten (nim-lang#17892) * gitutils: add diffStrings, diffFiles, and use it in testament to compare expected vs gotten * refactor with createTempDir * cleanup * refacotr * PRTEMP fake test spec changes to show effect of diffStrings * add runnableExamples for experimental/diff + cross-reference with gitutils * Revert "PRTEMP fake test spec changes to show effect of diffStrings" This reverts commit 57dc8d6.
diff -uNdr
with an API calltempfiles.genTempPath
example
I added (and reverted) a temporary commit that added intentional changes in test "expected output", to show what it looks like in CI, see https://gist.github.com/timotheecour/515dde92cb29ce359a3f4b9546c247fd
note: unrelated, preexisting bug in std/tempfiles
as shown in https://gist.github.com/timotheecour/515dde92cb29ce359a3f4b9546c247fd, it looks like
randomPathName
is buggy on windows: see #17898;this doesn't affect this PR though because I'm using a prefix diffStrings_a and diffStrings_b so there is no clash here (but it's still a bug that should be fixed in future work)