File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 11package runner
22
33import (
4- "context"
54 "os"
65 "path/filepath"
76 "testing"
@@ -72,14 +71,12 @@ deny contains msg if {
7271 "name": "test"
7372 }
7473}`
75- go func () {
76- defer w .Close ()
77- w .Write ([]byte (testInput ))
78- }()
74+ w .Write ([]byte (testInput ))
75+ w .Close ()
7976 defer func () { os .Stdin = oldStdin }()
8077
8178 // Run the test
82- ctx := context . Background ()
79+ ctx := t . Context ()
8380 results , err := runner .Run (ctx , fileList )
8481 if err != nil {
8582 t .Fatalf ("Run failed: %v" , err )
@@ -140,7 +137,7 @@ metadata:
140137 }
141138
142139 // Run with a regular file (not stdin)
143- ctx := context . Background ()
140+ ctx := t . Context ()
144141 results , err := runner .Run (ctx , []string {configFile })
145142 if err != nil {
146143 t .Fatalf ("Run failed: %v" , err )
You can’t perform that action at this time.
0 commit comments