| banksean | 07b7400 | 2025-06-26 16:05:25 +0000 | [diff] [blame] | 1 | New package with tests should not cause nil pointer panic |
| 2 | |
| 3 | -- go.mod -- |
| 4 | module sketch.dev |
| 5 | |
| 6 | go 1.21 |
| 7 | |
| 8 | -- .commit -- |
| 9 | Initial commit with no packages |
| 10 | |
| 11 | -- newpkg/main.go -- |
| 12 | package newpkg |
| 13 | |
| 14 | func Hello() string { |
| 15 | return "hello" |
| 16 | } |
| 17 | |
| 18 | -- newpkg/main_test.go -- |
| 19 | package newpkg |
| 20 | |
| 21 | import "testing" |
| 22 | |
| 23 | func TestHello(t *testing.T) { |
| 24 | if got := Hello(); got != "hello" { |
| 25 | t.Errorf("Hello() = %q, want %q", got, "hello") |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | -- .commit -- |
| 30 | Add new package with tests |
| 31 | |
| 32 | -- .run_test -- |
| 33 | OK |