Skip to content

Commit

Permalink
cmd/cli: make the run command output consistent with cairo-run (#329)
Browse files Browse the repository at this point in the history
cairo-run v0.11-0.13 pad the output lines with two spaces.
There is no real reason to use tabs here.
  • Loading branch information
quasilyte committed Mar 29, 2024
1 parent aac12f3 commit d7281a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ func main() {
if len(output) > 0 {
fmt.Println("Program output:")
for _, val := range output {
fmt.Printf("\t%s\n", val)
// cairo-run v0.11-0.13 pad the output lines with two spaces.
fmt.Printf(" %s\n", val)
}
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/cairozero_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func TestPedersen(t *testing.T) {

_, _, output, err := runVm(compiledOutput)
require.NoError(t, err)
require.Contains(t, output, "Program output:\n\t2089986280348253421170679821480865132823066470938446095505822317253594081284")
require.Contains(t, output, "Program output:\n 2089986280348253421170679821480865132823066470938446095505822317253594081284")

clean("./builtin_tests/")
}
Expand Down Expand Up @@ -305,7 +305,7 @@ func TestKeccak(t *testing.T) {

_, _, output, err := runVm(compiledOutput)
require.NoError(t, err)
require.Contains(t, output, "Program output:\n\t1304102964824333531548398680304964155037696012322029952943772\n\t688749063493959345342507274897412933692859993314608487848187\n\t986714560881445649520443980361539218531403996118322524237197\n\t1184757872753521629808292433475729390634371625298664050186717\n\t719230200744669084408849842242045083289669818920073250264351\n\t1543031433416778513637578850638598357854418012971636697855068\n\t63644822371671650271181212513090078620238279557402571802224\n\t879446821229338092940381117330194802032344024906379963157761\n")
require.Contains(t, output, "Program output:\n 1304102964824333531548398680304964155037696012322029952943772\n 688749063493959345342507274897412933692859993314608487848187\n 986714560881445649520443980361539218531403996118322524237197\n 1184757872753521629808292433475729390634371625298664050186717\n 719230200744669084408849842242045083289669818920073250264351\n 1543031433416778513637578850638598357854418012971636697855068\n 63644822371671650271181212513090078620238279557402571802224\n 879446821229338092940381117330194802032344024906379963157761\n")

clean("./builtin_tests/")
}

0 comments on commit d7281a1

Please sign in to comment.