-
Notifications
You must be signed in to change notification settings - Fork 1
fix: collect the output of gm repo compare in the tests
#198
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
base: main
Are you sure you want to change the base?
Conversation
|
Byte streams are the normal output of external commands. They can be used as strings as long as they parse as UTF-8, and they can also be used as binary. Having a byte stream isn't unusual, and you might also see Since the culprit is the value of |
|
well, i can't reproduce this for now 🤔 if i add a few debug prints to the test to extract the values of diff --git a/pkgs/nu-git-manager-sugar/tests/git.nu b/pkgs/nu-git-manager-sugar/tests/git.nu
index 9057dfe..df5414e 100644
--- a/pkgs/nu-git-manager-sugar/tests/git.nu
+++ b/pkgs/nu-git-manager-sugar/tests/git.nu
@@ -356,6 +356,12 @@ export def branch-compare [] {
"\\ No newline at end of file"
"",
]
+ print "ACTUAL---"
+ print (gm repo compare main)
+ print "---END"
+ print "EXPECTED"
+ print ($expected | str join "\n")
+ print "---END"
assert equal (gm repo compare main) ($expected | str join "\n")
assert equal (gm repo compare main --head HEAD) ($expected | str join "\n")
i get let actual = 'diff --git a/foo.txt b/foo.txt
new file mode 100644
index 0000000..1910281
--- /dev/null
+++ b/foo.txt
@@ -0,0 +1 @@
+foo
\ No newline at end of file'
let expected = 'diff --git a/foo.txt b/foo.txt
new file mode 100644
index 0000000..1910281
--- /dev/null
+++ b/foo.txt
@@ -0,0 +1 @@
+foo
\ No newline at end of file
'but use std assert
assert equal $actual $expecteddoes not fail with the "span" issue ideamaybe that's because ^echo "foo" | describe # shows "byte stream"but assert equal (^echo "foo") "foo" # does not fail |
|
also, if would expect |
|
I thought the CI error was because you are running ubuntu 20.04 in CI versus ubuntu latest. |
|
@fdncred maybe you're referring to the failing CI from nushell/nupm#94? 😋 |
|
@amtoine Ya, sorry. |
|
@fdncred aha, no worries, these two CI issues are haunting my dreams 🤣 |
related to
running
tk test compare --verbosewould give the following error:it appears the
gm repo branch comparecommand outputs a "byte stream" instead of astring🤔what i don't understand:
get-committest passes withoutcollect, becausegm repo get commitalso returns a byte stream instead of astring