Debian Codegraph @

matchers/is_nil_test.go

raw symbols SCIP
1 package matchers_testscip-go gomod github.com/poy/onpar . `github.com/poy/onpar/matchers_test`/
2
3 import (
4 "testingscip-go gomod github.com/golang/go/src go1.21.4 testing/"
5
6 "github.com/poy/onpar/matchersscip-go gomod github.com/poy/onpar . `github.com/poy/onpar/matchers`/"
7 )
8
9 func TestBeNilscip-go gomod github.com/poy/onpar . `github.com/poy/onpar/matchers_test`/TestBeNil().(t *testingscip-go gomod github.com/golang/go/src go1.21.4 testing/.Tscip-go gomod github.com/golang/go/src go1.21.4 testing/T#) {
10 t.Parallelscip-go gomod github.com/golang/go/src go1.21.4 testing/T#Parallel().()
11
12 m := matchersscip-go gomod github.com/poy/onpar . `github.com/poy/onpar/matchers`/.BeNilscip-go gomod github.com/poy/onpar . `github.com/poy/onpar/matchers`/BeNil().()
13
14 _, err := m.Matchscip-go gomod github.com/poy/onpar . `github.com/poy/onpar/matchers`/BeNilMatcher#Match().(nil)
15 if err != nil {
16 t.Errorscip-go gomod github.com/golang/go/src go1.21.4 testing/common#Error().("expected err to be nil")
17 }
18
19 v, err := m.Matchscip-go gomod github.com/poy/onpar . `github.com/poy/onpar/matchers`/BeNilMatcher#Match().(42)
20 if err == nil {
21 t.Errorscip-go gomod github.com/golang/go/src go1.21.4 testing/common#Error().("expected err to not be nil")
22 }
23
24 if v != 42 {
25 t.Errorfscip-go gomod github.com/golang/go/src go1.21.4 testing/common#Errorf().("expected %v to equal %d", v, 42)
26 }
27
28 var x map[string]string
29 _, err = m.Matchscip-go gomod github.com/poy/onpar . `github.com/poy/onpar/matchers`/BeNilMatcher#Match().(x)
30 if err != nil {
31 t.Errorscip-go gomod github.com/golang/go/src go1.21.4 testing/common#Error().("expected err to be nil")
32 }
33
34 x = map[string]string{}
35
36 _, err = m.Matchscip-go gomod github.com/poy/onpar . `github.com/poy/onpar/matchers`/BeNilMatcher#Match().(x)
37 if err == nil {
38 t.Errorscip-go gomod github.com/golang/go/src go1.21.4 testing/common#Error().("expected err to not be nil")
39 }
40 }