Skip to content

Commit

Permalink
Merge pull request #212 from bradleyjkemp/master
Browse files Browse the repository at this point in the history
Make snapshots more readable and diffable
  • Loading branch information
elliotchance authored Aug 12, 2017
2 parents 174fb9d + a531c68 commit f315202
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .snapshots/c2go-TestCLI-func1-AstHelpFlag
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
(string) (len=51) "Usage: test ast file.c\n -h\tprint help information\n"
([]string) (len=3) {
(string) (len=22) "Usage: test ast file.c",
(string) (len=27) " -h\tprint help information",
(string) ""
}
6 changes: 5 additions & 1 deletion .snapshots/c2go-TestCLI-func1-AstNoFilesHelp
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
(string) (len=51) "Usage: test ast file.c\n -h\tprint help information\n"
([]string) (len=3) {
(string) (len=22) "Usage: test ast file.c",
(string) (len=27) " -h\tprint help information",
(string) ""
}
11 changes: 10 additions & 1 deletion .snapshots/c2go-TestCLI-func1-TranspileHelpFlag
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
(string) (len=256) "Usage: test transpile [-V] [-o file.go] [-p package] file.c\n -V\tprint progress as comments\n -h\tprint help information\n -o string\n \toutput Go generated code to the specified file\n -p string\n \tset the name of the generated package (default \"main\")\n"
([]string) (len=8) {
(string) (len=59) "Usage: test transpile [-V] [-o file.go] [-p package] file.c",
(string) (len=31) " -V\tprint progress as comments",
(string) (len=27) " -h\tprint help information",
(string) (len=11) " -o string",
(string) (len=51) " \toutput Go generated code to the specified file",
(string) (len=11) " -p string",
(string) (len=59) " \tset the name of the generated package (default \"main\")",
(string) ""
}
11 changes: 10 additions & 1 deletion .snapshots/c2go-TestCLI-func1-TranspileNoFilesHelp
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
(string) (len=256) "Usage: test transpile [-V] [-o file.go] [-p package] file.c\n -V\tprint progress as comments\n -h\tprint help information\n -o string\n \toutput Go generated code to the specified file\n -p string\n \tset the name of the generated package (default \"main\")\n"
([]string) (len=8) {
(string) (len=59) "Usage: test transpile [-V] [-o file.go] [-p package] file.c",
(string) (len=31) " -V\tprint progress as comments",
(string) (len=27) " -h\tprint help information",
(string) (len=11) " -o string",
(string) (len=51) " \toutput Go generated code to the specified file",
(string) (len=11) " -p string",
(string) (len=59) " \tset the name of the generated package (default \"main\")",
(string) ""
}
4 changes: 3 additions & 1 deletion cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"github.com/bradleyjkemp/cupaloy"
"os"
"strings"
"testing"
)

Expand Down Expand Up @@ -42,7 +43,8 @@ func TestCLI(t *testing.T) {
defer teardown()

runCommand()
err := cupaloy.SnapshotMulti(testName, output.String())
outputLines := strings.Split(output.String(), "\n")
err := cupaloy.SnapshotMulti(testName, outputLines)
if err != nil {
t.Fatalf("error: %s", err)
}
Expand Down

0 comments on commit f315202

Please sign in to comment.