go-pkg/rsql/ast_test.go

21 lines
407 B
Go
Raw Normal View History

2024-01-22 16:00:58 -07:00
package rsql
import "testing"
func TestString(t *testing.T) {
program := &Program{
Statements: []Statement {
ExpressionStatement{
Token: Token{TokEQ, "=="},
Expression: &InfixExpression{
Token: Token{TokEQ, "=="},
Left: &Identifier{Token{TokIdent,"foo"}, "foo"},
Operator: "==",
Right: &Integer{Token{TokInteger, "5"}, 5},
},
},
},
}
t.Log(program.String())
}