(t *testing.T)
| 1419 | } |
| 1420 | |
| 1421 | func Test_openUserFile(t *testing.T) { |
| 1422 | f, err := os.CreateTemp(t.TempDir(), "gh-test") |
| 1423 | if err != nil { |
| 1424 | t.Fatal(err) |
| 1425 | } |
| 1426 | defer f.Close() |
| 1427 | |
| 1428 | fmt.Fprint(f, "file contents") |
| 1429 | |
| 1430 | file, length, err := openUserFile(f.Name(), nil) |
| 1431 | if err != nil { |
| 1432 | t.Fatal(err) |
| 1433 | } |
| 1434 | defer file.Close() |
| 1435 | |
| 1436 | fb, err := io.ReadAll(file) |
| 1437 | if err != nil { |
| 1438 | t.Fatal(err) |
| 1439 | } |
| 1440 | |
| 1441 | assert.Equal(t, int64(13), length) |
| 1442 | assert.Equal(t, "file contents", string(fb)) |
| 1443 | } |
| 1444 | |
| 1445 | func Test_fillPlaceholders(t *testing.T) { |
| 1446 | type args struct { |
nothing calls this directly
no test coverage detected