cleanup(netx): another batch of small/simple cleanups (#789)
See https://github.com/ooni/probe/issues/2121
This commit is contained in:
parent
1cb820b19d
commit
ae24ba644c
7 changed files with 42 additions and 149 deletions
|
|
@ -31,3 +31,19 @@ func TestErrorToStringOrOK(t *testing.T) {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestValidLoggerOrDefault(t *testing.T) {
|
||||
t.Run("with nil argument", func(t *testing.T) {
|
||||
out := ValidLoggerOrDefault(nil)
|
||||
if out != DiscardLogger {
|
||||
t.Fatal("unexpected result")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("with non-nil argument", func(t *testing.T) {
|
||||
in := &logDiscarder{}
|
||||
if ValidLoggerOrDefault(in) != in {
|
||||
t.Fatal("unexpected result")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue