File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,9 @@ func RunBenchmarks(b *testing.B, testDir string) {
133133// RunScript runs the provided path to a script.
134134// RunScript captures the stdout and stderr while executing the script
135135// and compares it to a golden file:
136- // RunScript("./testdata/foo.py")
136+ //
137+ // RunScript("./testdata/foo.py")
138+ //
137139// will compare the output with "./testdata/foo_golden.txt".
138140func RunScript (t * testing.T , fname string ) {
139141 opts := py .DefaultContextOpts ()
@@ -180,6 +182,8 @@ func RunScript(t *testing.T, fname string) {
180182
181183 diff := cmp .Diff (string (want ), string (got ))
182184 if ! bytes .Equal (got , want ) {
185+ out := fname [:len (fname )- len (".py" )] + ".txt"
186+ _ = os .WriteFile (out , got , 0644 )
183187 t .Fatalf ("output differ: -- (-ref +got)\n %s" , diff )
184188 }
185189}
You can’t perform that action at this time.
0 commit comments