diff options
| author | Chris Nobody <[email protected]> | 2021-03-31 19:16:12 +0300 |
|---|---|---|
| committer | Chris Nobody <[email protected]> | 2021-04-01 10:46:54 +0300 |
| commit | bf9b51caf44ac2e75f44ab6e67684a30d7074001 (patch) | |
| tree | f96859618e0a8803d4b0d0e8186926e66a3fa7d8 /gocomplete/tests_test.go | |
| parent | 5d9f7f10f0af6142dc2f3b8733b807ed207f9ea7 (diff) | |
gocomplete: do not suppress test failures
Ensure that the components of the `testing` package that rely on calling
`os.Exit` remain functional and any test failures are actually reported
back after the `monkey.Patch` in the `gocomplete.Example` test.
Fix #135
Diffstat (limited to 'gocomplete/tests_test.go')
| -rw-r--r-- | gocomplete/tests_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gocomplete/tests_test.go b/gocomplete/tests_test.go index 750147a..a1238a4 100644 --- a/gocomplete/tests_test.go +++ b/gocomplete/tests_test.go @@ -43,7 +43,8 @@ func TestPredictions(t *testing.T) { func BenchmarkFake(b *testing.B) {} func Example() { - monkey.Patch(os.Exit, func(int) {}) + p := monkey.Patch(os.Exit, func(int) {}) + defer p.Unpatch() os.Setenv("COMP_LINE", "go ru") os.Setenv("COMP_POINT", "5") main() |
