Merge pull request #13 from piotrrojek/fix-11-chanel-directions-not-handled-correctly
Change `html/template` to `text/template`
This commit is contained in:
commit
ac5bfca30c
@ -8,10 +8,10 @@ import (
|
|||||||
"go/parser"
|
"go/parser"
|
||||||
"go/token"
|
"go/token"
|
||||||
"go/types"
|
"go/types"
|
||||||
"html/template"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
"text/template"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Mocker can generate mock structs.
|
// Mocker can generate mock structs.
|
||||||
|
@ -114,3 +114,24 @@ func TestNothingToReturn(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestChannelNames(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