Skip to content

Commit

Permalink
precision only works on fractional math fixes sass#7
Browse files Browse the repository at this point in the history
  • Loading branch information
drewwells committed Aug 1, 2015
1 parent 4a1feb3 commit ed38f15
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
)

func TestOption_precision(t *testing.T) {
t.Skip("precision does not work")
in := bytes.NewBufferString(`a { height: 1.1111px; }`)

in := bytes.NewBufferString(`a { height: (1/3)px; }`)

var out bytes.Buffer
ctx := Context{
Expand All @@ -19,7 +19,24 @@ func TestOption_precision(t *testing.T) {
}

e := `a {
height: 1.111px; }
height: 0.333 px; }
`
if e != out.String() {
t.Errorf("got:\n%s\nwanted:\n%s\n", out.String(), e)
}

in = bytes.NewBufferString(`a { height: (1/3)px; }`)
out.Reset()
ctx = Context{
Precision: 6,
}
err = ctx.Compile(in, &out)
if err != nil {
t.Fatal(err)
}

e = `a {
height: 0.333333 px; }
`
if e != out.String() {
t.Errorf("got:\n%s\nwanted:\n%s\n", out.String(), e)
Expand Down

0 comments on commit ed38f15

Please sign in to comment.