Skip to content

Commit

Permalink
Actually make -print-skip print a valid bash script
Browse files Browse the repository at this point in the history
Previously it was only valid with zsh; seems bash really wants those
curly braces.
  • Loading branch information
arp242 committed May 31, 2024
1 parent e7098e2 commit f0b5cdd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cmd/toml-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ func main() {
fmt.Printf(", %2d skipped", tests.Skipped)
}
if printSkip && (tests.FailedValid > 0 || tests.FailedInvalid > 0) {
fmt.Print("\n\n #!/usr/bin/env bash\n skip=(\n")
fmt.Print("\n\n #!/usr/bin/env bash\n # Also compatible with zsh.\n skip=(\n")
for _, f := range tests.Tests {
if f.Failed() {
fmt.Printf(" -skip '%s'\n", f.Path)
}
}
fmt.Println(" )")
fmt.Print(" toml-test $skip[@] " + strings.Join(cmd, " "))
fmt.Print(" toml-test ${skip[@]} " + strings.Join(cmd, " "))
if runner.Encoder {
fmt.Print(" -encoder")
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/toml-test/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ Flags:
-parallel Number of tests to run in parallel; defaults to GOMAXPROCS,
normally the number of cores available.
-print-skip Print a small bash script with -skip flag for failing tests;
useful to get a list of "known failures" for CI integrations
and such.
-print-skip Print a small bash/zsh script with -skip flag for failing
tests; useful to get a list of "known failures" for CI
integrations and such.
-int-as-float Treat all integers as floats, rather than integers. This also
skips the int64 test as that's outside of the safe float
Expand Down
7 changes: 2 additions & 5 deletions tests/valid/spec/string-6.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"regex2": {"type": "string", "value": "I [dw]on't need \\d{2} apples"},
"lines": {
"type": "string",
"value": "The first newline is\ntrimmed in raw strings.\n All other whitespace\n is preserved.\n"
}
"lines": {"type": "string", "value": "The first newline is\ntrimmed in raw strings.\n All other whitespace\n is preserved.\n"},
"regex2": {"type": "string", "value": "I [dw]on't need \\d{2} apples"}
}

0 comments on commit f0b5cdd

Please sign in to comment.