@@ -68,11 +68,12 @@ func TestReadWriteJSONL(t *testing.T) {
68
68
"skip_both.jsonl" ,
69
69
"skip_both.jsonl" ,
70
70
"outdated.jsonl" ,
71
+ "known_outdated.jsonl" ,
71
72
}
72
73
73
74
for _ , file := range files {
74
75
t .Run (file , func (t * testing.T ) {
75
- f := filepath .Join ("testdata" , "actions " , file )
76
+ f := filepath .Join ("testdata" , "jsonl " , file )
76
77
stdout := & bytes.Buffer {}
77
78
stderr := & bytes.Buffer {}
78
79
@@ -126,7 +127,7 @@ func TestWriteGoToStdout(t *testing.T) {
126
127
t .Run (tc .in , func (t * testing.T ) {
127
128
stdout := & bytes.Buffer {}
128
129
stderr := & bytes.Buffer {}
129
- status := newGen (stdout , stderr , io .Discard ).run ([]string {"test" , "-s" , filepath .Join ("testdata" , "actions " , tc .in )})
130
+ status := newGen (stdout , stderr , io .Discard ).run ([]string {"test" , "-s" , filepath .Join ("testdata" , "jsonl " , tc .in )})
130
131
if status != 0 {
131
132
t .Fatalf ("exit status is non-zero: %d: %s" , status , stderr .Bytes ())
132
133
}
@@ -146,7 +147,7 @@ func TestWriteGoToStdout(t *testing.T) {
146
147
}
147
148
148
149
func TestWriteJSONLFile (t * testing.T ) {
149
- in := filepath .Join ("testdata" , "actions " , "no_new_version.jsonl" )
150
+ in := filepath .Join ("testdata" , "jsonl " , "no_new_version.jsonl" )
150
151
b , err := os .ReadFile (in )
151
152
if err != nil {
152
153
panic (err )
@@ -175,7 +176,7 @@ func TestWriteJSONLFile(t *testing.T) {
175
176
}
176
177
177
178
func TestWriteGoFile (t * testing.T ) {
178
- in := filepath .Join ("testdata" , "actions " , "no_new_version.jsonl" )
179
+ in := filepath .Join ("testdata" , "jsonl " , "no_new_version.jsonl" )
179
180
out := filepath .Join ("testdata" , "go" , "out.go" )
180
181
defer os .Remove (out )
181
182
@@ -246,7 +247,7 @@ func TestWriteOutdatedActionAsJSONL(t *testing.T) {
246
247
t .Fatal ("exit status is non-zero:" , status )
247
248
}
248
249
249
- b , err := os .ReadFile (filepath .Join ("testdata" , "actions " , "outdated.jsonl" ))
250
+ b , err := os .ReadFile (filepath .Join ("testdata" , "jsonl " , "outdated.jsonl" ))
250
251
if err != nil {
251
252
panic (err )
252
253
}
@@ -257,7 +258,7 @@ func TestWriteOutdatedActionAsJSONL(t *testing.T) {
257
258
}
258
259
259
260
func TestLogOutput (t * testing.T ) {
260
- f := filepath .Join ("testdata" , "actions " , "no_new_version.jsonl" )
261
+ f := filepath .Join ("testdata" , "jsonl " , "no_new_version.jsonl" )
261
262
stdout := & bytes.Buffer {}
262
263
logged := & bytes.Buffer {}
263
264
status := newGen (stdout , io .Discard , logged ).run ([]string {"test" , "-s" , f , "-f" , "jsonl" })
@@ -355,7 +356,7 @@ func TestCouldNotReadJSONLFile(t *testing.T) {
355
356
}
356
357
for _ , tc := range testCases {
357
358
t .Run (tc .file , func (t * testing.T ) {
358
- f := filepath .Join ("testdata" , "actions " , tc .file )
359
+ f := filepath .Join ("testdata" , "jsonl " , tc .file )
359
360
stdout := io .Discard
360
361
stderr := & bytes.Buffer {}
361
362
@@ -373,7 +374,7 @@ func TestCouldNotReadJSONLFile(t *testing.T) {
373
374
}
374
375
375
376
func TestCouldNotCreateOutputFile (t * testing.T ) {
376
- f := filepath .Join ("testdata" , "actions " , "no_new_version.jsonl" )
377
+ f := filepath .Join ("testdata" , "jsonl " , "no_new_version.jsonl" )
377
378
out := filepath .Join ("testdata" , "this-dir-does-not-exit" , "foo.jsonl" )
378
379
stdout := io .Discard
379
380
stderr := & bytes.Buffer {}
@@ -398,7 +399,7 @@ func (w testErrorWriter) Write(b []byte) (int, error) {
398
399
func TestWriteError (t * testing.T ) {
399
400
for _ , format := range []string {"go" , "jsonl" } {
400
401
t .Run (format , func (t * testing.T ) {
401
- f := filepath .Join ("testdata" , "actions " , "no_new_version.jsonl" )
402
+ f := filepath .Join ("testdata" , "jsonl " , "no_new_version.jsonl" )
402
403
stdout := testErrorWriter {}
403
404
stderr := & bytes.Buffer {}
404
405
0 commit comments