xgo/parser/parser_precendence_test.go

12 lines
241 B
Go
Raw Normal View History

2019-01-09 10:17:42 +03:00
package parser_test
import (
"testing"
)
func TestPrecedence(t *testing.T) {
expectString(t, `a + b + c`, `((a + b) + c)`)
expectString(t, `a + b * c`, `(a + (b * c))`)
expectString(t, `x = 2 * 1 + 3 / 4`, `x = ((2 * 1) + (3 / 4))`)
}