mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 14:11:44 +00:00
lib/errors: Assert warning against nil error in tests (#40631)
This commit is contained in:
parent
066baf25a7
commit
e2ae15ea28
@ -5,8 +5,15 @@ import (
|
||||
)
|
||||
|
||||
func TestWarningError(t *testing.T) {
|
||||
err := New("foo")
|
||||
var ref Warning
|
||||
var err error
|
||||
|
||||
// Ensure that a nil error is not a warning type error.
|
||||
if As(err, &ref) {
|
||||
t.Error(`Expected nil error to NOT be of type warning`)
|
||||
}
|
||||
|
||||
err = New("foo")
|
||||
|
||||
// Ensure that all errors are not a warning type error.
|
||||
if As(err, &ref) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user