Skip to content

Commit 50258c5

Browse files
committed
Fix tests
After enabling tests in CI, I realized they weren't passing (due to #2). This fixes a regression introduced in #2 and updates the tests to the intended changes from #2.
1 parent 289b279 commit 50258c5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ func (p prog) run() (string, error) {
6868

6969
switch p.output {
7070
case "env":
71-
return fmt.Sprintf(`SHARD_TESTS="%s"\nSHARD_PATHS="%s"`, pattern, strings.Join(paths, " ")), nil
71+
return fmt.Sprintf(`SHARD_TESTS="%s"
72+
SHARD_PATHS="%s"`, pattern, strings.Join(paths, " ")), nil
7273
default:
7374
return fmt.Sprintf(`-run "%s" %s`, pattern, strings.Join(paths, " ")), nil
7475
}

main_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ func TestProg(t *testing.T) {
1515
{
1616
name: "default output",
1717
p: prog{total: 1, root: "."},
18-
want: `-run ^(?:TestAssign|TestCollect|TestProg)\$ ./. ./internal`,
18+
want: `-run "^(?:TestAssign|TestCollect|TestProg)\$" ./. ./internal`,
1919
},
2020
{
2121
name: "env output",
2222
p: prog{output: "env", total: 1, root: "."},
23-
want: `SHARD_TESTS=^(?:TestAssign|TestCollect|TestProg)\$
24-
SHARD_PATHS=./. ./internal`,
23+
want: `SHARD_TESTS="^(?:TestAssign|TestCollect|TestProg)\$"
24+
SHARD_PATHS="./. ./internal"`,
2525
},
2626
}
2727

0 commit comments

Comments
 (0)