From 1086a0aef5fb4b2fb2e6e1e9b6c45b9d0090a484 Mon Sep 17 00:00:00 2001 From: Boris Kayi Date: Sun, 6 Aug 2023 01:40:08 +0200 Subject: [PATCH] test: more tests --- glox/ast/print_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/glox/ast/print_test.go b/glox/ast/print_test.go index 055814c..7534942 100644 --- a/glox/ast/print_test.go +++ b/glox/ast/print_test.go @@ -37,6 +37,16 @@ func TestPrint(t *testing.T) { Name: token.Token{Type: token.IDENTIFIER, Lexeme: "number", Line: 1}, Value: NewLiteralExpression(12), }, + &Logical{ + Left: &Literal{Value: true}, + Operator: token.Token{Type: token.AND, Lexeme: "and", Line: 1}, + Right: &Literal{Value: false}, + }, + &Logical{ + Left: &Literal{Value: true}, + Operator: token.Token{Type: token.OR, Lexeme: "or", Line: 1}, + Right: &Literal{Value: false}, + }, } printer := NewPrinter()