aboutsummaryrefslogtreecommitdiff
path: root/parser/parser_test.go
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-03-08 21:38:19 +0000
committerBobby <[email protected]>2024-03-08 21:38:19 +0000
commit87b188bae2c8a2a9f81e872805d072be7ec910b2 (patch)
treeb3c48ba591966e424b1bb55dba1f652733368a34 /parser/parser_test.go
parentb52f4e9b4140f482ad966aa354b39cd305a212ec (diff)
downloadmana-87b188bae2c8a2a9f81e872805d072be7ec910b2.tar.xz
mana-87b188bae2c8a2a9f81e872805d072be7ec910b2.zip
ast: fn init
Diffstat (limited to 'parser/parser_test.go')
-rw-r--r--parser/parser_test.go14
1 files changed, 7 insertions, 7 deletions
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)