Confirm erroneous encoding of "<" sign
This commit is contained in:
parent
9153bd984b
commit
8e7263835a
@ -114,3 +114,24 @@ func TestNothingToReturn(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestChannelsName(t *testing.T) {
|
||||
m, err := New("testdata/channels", "")
|
||||
if err != nil {
|
||||
t.Errorf("moq.New: %s", err)
|
||||
}
|
||||
var buf bytes.Buffer
|
||||
err = m.Mock(&buf, "Queuer")
|
||||
if err != nil {
|
||||
t.Errorf("m.Mock: %s", err)
|
||||
}
|
||||
s := buf.String()
|
||||
var strs = []string{
|
||||
"func (mock *QueuerMock) Sub(topic string) (<-chan Queue, error)",
|
||||
}
|
||||
for _, str := range strs {
|
||||
if !strings.Contains(s, str) {
|
||||
t.Errorf("expected by missing: \"%s\"", str)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
7
package/moq/testdata/channels/example.go
vendored
Normal file
7
package/moq/testdata/channels/example.go
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
package channels
|
||||
|
||||
type Queue []string
|
||||
|
||||
type Queuer interface {
|
||||
Sub(topic string) (<-chan Queue, error)
|
||||
}
|
Loading…
Reference in New Issue
Block a user