diff --git a/circle.yml b/circle.yml index d478a0c..463d22e 100644 --- a/circle.yml +++ b/circle.yml @@ -25,4 +25,4 @@ dependencies: - go test -i -race $(go list -f '{{if len .TestGoFiles}}{{.ImportPath}}{{end}}' ./... | grep -v /vendor/) test: override: - - go test -short -race $(go list -f '{{if len .TestGoFiles}}{{.ImportPath}}{{end}}' ./... | grep -v /vendor/) + - go test -v -short -race $(go list -f '{{if len .TestGoFiles}}{{.ImportPath}}{{end}}' ./... | grep -v /vendor/) diff --git a/context_nowin_test.go b/context_nowin_test.go new file mode 100644 index 0000000..327639c --- /dev/null +++ b/context_nowin_test.go @@ -0,0 +1,41 @@ +// build !windows +package libsass + +import ( + "bytes" + "testing" +) + +func TestLibsassError(t *testing.T) { + + in := bytes.NewBufferString(`div { + color: red(blue, purple); +}`) + + var out bytes.Buffer + ctx := NewContext() + + ctx.Funcs.Add(Func{ + Sign: "foo()", + Fn: TestCallback, + Ctx: &ctx, + }) + err := ctx.Compile(in, &out) + + if err == nil { + t.Error("No error thrown for incorrect arity") + } + + if e := "wrong number of arguments (2 for 1) for `red'"; e != ctx.err.Message { + t.Errorf("wanted:%s\ngot:%s\n", e, ctx.err.Message) + } + e := `Error > stdin:2 +wrong number of arguments (2 for 1) for ` + "`" + `red' +div { + color: red(blue, purple); +} +` + if e != err.Error() { + t.Errorf("wanted:\n%s\ngot:\n%s\n", e, err) + } +} diff --git a/context_test.go b/context_test.go index 42acbcf..b93b57f 100644 --- a/context_test.go +++ b/context_test.go @@ -98,44 +98,6 @@ div { } -func TestLibsassError(t *testing.T) { - - if testing.Short() { - t.Skip("Skip error testing on windows") - } - - in := bytes.NewBufferString(`div { - color: red(blue, purple); -}`) - - var out bytes.Buffer - ctx := NewContext() - - ctx.Funcs.Add(Func{ - Sign: "foo()", - Fn: TestCallback, - Ctx: &ctx, - }) - err := ctx.Compile(in, &out) - - if err == nil { - t.Error("No error thrown for incorrect arity") - } - - if e := "wrong number of arguments (2 for 1) for `red'"; e != ctx.err.Message { - t.Errorf("wanted:%s\ngot:%s\n", e, ctx.err.Message) - } - e := `Error > stdin:2 -wrong number of arguments (2 for 1) for ` + "`" + `red' -div { - color: red(blue, purple); -} -` - if e != err.Error() { - t.Errorf("wanted:\n%s\ngot:\n%s\n", e, err) - } -} - func ExampleContext_Compile() { in := bytes.NewBufferString(`div { color: red(blue);