mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-04 10:57:50 +08:00
Fully cover util/exception.go.
This commit is contained in:
parent
31fb99daa7
commit
eebb759edb
|
@ -43,4 +43,14 @@ func TestException(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Errorf("Catch recovered panic not caused via Throw")
|
||||
}
|
||||
|
||||
// Catch should do nothing when there is no panic
|
||||
err = nil
|
||||
f = func() {
|
||||
defer Catch(&err)
|
||||
}
|
||||
f()
|
||||
if err != nil {
|
||||
t.Errorf("Catch recovered something when there is no panic")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user