(t *testing.T)
| 1531 | } |
| 1532 | |
| 1533 | func Test_openUserFile(t *testing.T) { |
| 1534 | f, err := os.CreateTemp(t.TempDir(), "gh-test") |
| 1535 | if err != nil { |
| 1536 | t.Fatal(err) |
| 1537 | } |
| 1538 | defer f.Close() |
| 1539 | |
| 1540 | fmt.Fprint(f, "file contents") |
| 1541 | |
| 1542 | file, length, err := openUserFile(f.Name(), nil) |
| 1543 | if err != nil { |
| 1544 | t.Fatal(err) |
| 1545 | } |
| 1546 | defer file.Close() |
| 1547 | |
| 1548 | fb, err := io.ReadAll(file) |
| 1549 | if err != nil { |
| 1550 | t.Fatal(err) |
| 1551 | } |
| 1552 | |
| 1553 | assert.Equal(t, int64(13), length) |
| 1554 | assert.Equal(t, "file contents", string(fb)) |
| 1555 | } |
| 1556 | |
| 1557 | func Test_fillPlaceholders(t *testing.T) { |
| 1558 | type args struct { |
nothing calls this directly
no test coverage detected