xgo/parser/parser_precendence_test.go
2019-01-08 23:17:42 -08:00

11 lines
241 B
Go

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))`)
}