-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathmixin_invocation_test.go
More file actions
49 lines (37 loc) · 967 Bytes
/
mixin_invocation_test.go
File metadata and controls
49 lines (37 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package gcss
import (
"io/ioutil"
"testing"
)
func Test_mixinInvocation_WriteTo(t *testing.T) {
ln := newLine(1, "$test(10px, blue)")
mi, err := newMixinInvocation(ln, nil)
if err != nil {
t.Errorf("error occurred [error: %q]", err.Error())
return
}
if _, err := mi.WriteTo(ioutil.Discard); err != nil {
t.Errorf("error occurred [error: %q]", err.Error())
return
}
}
func Test_newMixinInvocation(t *testing.T) {
ln := newLine(1, "$test(10px, blue)")
_, err := newMixinInvocation(ln, nil)
if err != nil {
t.Errorf("error occurred [error: %q]", err.Error())
return
}
}
func Test_newMixinInvocation_err(t *testing.T) {
ln := newLine(1, "test(10px, blue)")
_, err := newMixinInvocation(ln, nil)
if err == nil {
t.Error("error should occur")
return
}
if expected, actual := "mixin must start with \"$\" [line: 1]", err.Error(); actual != expected {
t.Errorf("error should be %q [actual: %q]", expected, actual)
return
}
}