Skip to content

Commit

Permalink
umm short doesnt work on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
drewwells committed Dec 22, 2015
1 parent e42c971 commit 808b1b1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 39 deletions.
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
41 changes: 41 additions & 0 deletions context_nowin_test.go
Original file line number Diff line number Diff line change
@@ -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)
}
}
38 changes: 0 additions & 38 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 808b1b1

Please sign in to comment.