From 550aa0a288a00d820927a84b4f54a25f6c544643 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 20 Jun 2023 08:57:11 +0200 Subject: any --- parser/parser_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'parser') diff --git a/parser/parser_test.go b/parser/parser_test.go index a7f9775..7b91214 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -12,7 +12,7 @@ func TestLetStatements(t *testing.T) { tests := []struct { input string expectedIdentifier string - expectedValue interface{} + expectedValue any }{ {"let x = 5;", "x", 5}, {"let y = true;", "y", true}, @@ -44,7 +44,7 @@ func TestLetStatements(t *testing.T) { func TestReturnStatements(t *testing.T) { tests := []struct { input string - expectedValue interface{} + expectedValue any }{ {"return 5;", 5}, {"return true;", true}, @@ -135,7 +135,7 @@ func TestParsingPrefixExpressions(t *testing.T) { prefixTests := []struct { input string operator string - value interface{} + value any }{ {"!5;", "!", 5}, {"-15;", "-", 15}, @@ -176,9 +176,9 @@ func TestParsingPrefixExpressions(t *testing.T) { func TestParsingInfixExpressions(t *testing.T) { infixTests := []struct { input string - leftValue interface{} + leftValue any operator string - rightValue interface{} + rightValue any }{ {"5 + 5;", 5, "+", 5}, {"5 - 5;", 5, "-", 5}, @@ -934,7 +934,7 @@ func testLetStatement(t *testing.T, s ast.Statement, name string) bool { return true } -func testInfixExpression(t *testing.T, exp ast.Expression, left interface{}, operator string, right interface{}) bool { +func testInfixExpression(t *testing.T, exp ast.Expression, left any, operator string, right any) bool { t.Helper() opExp, ok := exp.(*ast.InfixExpression) if !ok { @@ -958,7 +958,7 @@ func testInfixExpression(t *testing.T, exp ast.Expression, left interface{}, ope return true } -func testLiteralExpression(t *testing.T, exp ast.Expression, expected interface{}) bool { +func testLiteralExpression(t *testing.T, exp ast.Expression, expected any) bool { t.Helper() switch v := expected.(type) { case int: -- cgit v1.2.3