From 87b188bae2c8a2a9f81e872805d072be7ec910b2 Mon Sep 17 00:00:00 2001 From: Bobby Date: Fri, 8 Mar 2024 21:38:19 +0000 Subject: ast: fn init --- parser/parser_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'parser/parser_test.go') diff --git a/parser/parser_test.go b/parser/parser_test.go index a9754f5..08539b7 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -9,10 +9,10 @@ import ( func TestLetStatements(t *testing.T) { tests := []struct { - input string + input string expectedIdentifier string - expectedValue interface{} - } { + expectedValue interface{} + }{ {"let x = 5;", "x", 5}, {"let y = true;", "y", true}, {"let foobar = y;", "foobar", "y"}, @@ -303,9 +303,9 @@ func TestBooleanExpression(t *testing.T) { // Prefix expression tests. func TestParsingPrefixExpressions(t *testing.T) { var prefixTests = []struct { - input string - operator string - value interface{} + input string + operator string + value interface{} }{ {"!5;", "!", 5}, {"-15;", "-", 15}, @@ -722,7 +722,7 @@ func TestFunctionParameterParsing(t *testing.T) { var program *ast.Program = p.ParseProgram() checkParserErrors(t, p) - + stmt := program.Statements[0].(*ast.ExpressionStatement) function := stmt.Expression.(*ast.FunctionLiteral) -- cgit v1.2.3