(t *testing.T)
| 1499 | } |
| 1500 | |
| 1501 | func Test_openUserFile(t *testing.T) { |
| 1502 | f, err := os.CreateTemp(t.TempDir(), "gh-test") |
| 1503 | if err != nil { |
| 1504 | t.Fatal(err) |
| 1505 | } |
| 1506 | defer f.Close() |
| 1507 | |
| 1508 | fmt.Fprint(f, "file contents") |
| 1509 | |
| 1510 | file, length, err := openUserFile(f.Name(), nil) |
| 1511 | if err != nil { |
| 1512 | t.Fatal(err) |
| 1513 | } |
| 1514 | defer file.Close() |
| 1515 | |
| 1516 | fb, err := io.ReadAll(file) |
| 1517 | if err != nil { |
| 1518 | t.Fatal(err) |
| 1519 | } |
| 1520 | |
| 1521 | assert.Equal(t, int64(13), length) |
| 1522 | assert.Equal(t, "file contents", string(fb)) |
| 1523 | } |
| 1524 | |
| 1525 | func Test_fillPlaceholders(t *testing.T) { |
| 1526 | type args struct { |
nothing calls this directly
no test coverage detected