Confirm erroneous encoding of "<" sign

This commit is contained in:
Piotr Rojek 2017-03-07 14:21:58 +01:00
parent 9153bd984b
commit 8e7263835a
2 changed files with 28 additions and 0 deletions

View File

@ -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)
}
}
}

View File

@ -0,0 +1,7 @@
package channels
type Queue []string
type Queuer interface {
Sub(topic string) (<-chan Queue, error)
}