File tree 1 file changed +5
-1
lines changed 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) {
133
133
// RunScript runs the provided path to a script.
134
134
// RunScript captures the stdout and stderr while executing the script
135
135
// and compares it to a golden file:
136
- // RunScript("./testdata/foo.py")
136
+ //
137
+ // RunScript("./testdata/foo.py")
138
+ //
137
139
// will compare the output with "./testdata/foo_golden.txt".
138
140
func RunScript (t * testing.T , fname string ) {
139
141
opts := py .DefaultContextOpts ()
@@ -180,6 +182,8 @@ func RunScript(t *testing.T, fname string) {
180
182
181
183
diff := cmp .Diff (string (want ), string (got ))
182
184
if ! bytes .Equal (got , want ) {
185
+ out := fname [:len (fname )- len (".py" )] + ".txt"
186
+ _ = os .WriteFile (out , got , 0644 )
183
187
t .Fatalf ("output differ: -- (-ref +got)\n %s" , diff )
184
188
}
185
189
}
You can’t perform that action at this time.
0 commit comments