summaryrefslogtreecommitdiff
path: root/gocomplete/tests_test.go
diff options
context:
space:
mode:
authorChris Nobody <[email protected]>2021-03-31 19:16:12 +0300
committerChris Nobody <[email protected]>2021-04-01 10:46:54 +0300
commitbf9b51caf44ac2e75f44ab6e67684a30d7074001 (patch)
treef96859618e0a8803d4b0d0e8186926e66a3fa7d8 /gocomplete/tests_test.go
parent5d9f7f10f0af6142dc2f3b8733b807ed207f9ea7 (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.go3
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()