aboutsummaryrefslogtreecommitdiff
path: root/parser/parser_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'parser/parser_test.go')
-rw-r--r--parser/parser_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/parser/parser_test.go b/parser/parser_test.go
index df040ad..ed019af 100644
--- a/parser/parser_test.go
+++ b/parser/parser_test.go
@@ -951,6 +951,7 @@ func TestParsingHashLiteralsWithExpressions(t *testing.T) {
}
func testLetStatement(t *testing.T, s ast.Statement, name string) bool {
+ t.Helper()
if s.TokenLiteral() != "let" {
t.Errorf("s.TokenLiteral not 'let'. got=%q", s.TokenLiteral())
return false
@@ -976,6 +977,7 @@ func testLetStatement(t *testing.T, s ast.Statement, name string) bool {
}
func testInfixExpression(t *testing.T, exp ast.Expression, left interface{}, operator string, right interface{}) bool {
+ t.Helper()
opExp, ok := exp.(*ast.InfixExpression)
if !ok {
t.Errorf("exp is not ast.OperatorExpression. got=%T(%s)", exp, exp)
@@ -999,6 +1001,7 @@ func testInfixExpression(t *testing.T, exp ast.Expression, left interface{}, ope
}
func testLiteralExpression(t *testing.T, exp ast.Expression, expected interface{}) bool {
+ t.Helper()
switch v := expected.(type) {
case int:
return testIntegerLiteral(t, exp, int64(v))
@@ -1014,6 +1017,7 @@ func testLiteralExpression(t *testing.T, exp ast.Expression, expected interface{
}
func testIntegerLiteral(t *testing.T, il ast.Expression, value int64) bool {
+ t.Helper()
integ, ok := il.(*ast.IntegerLiteral)
if !ok {
t.Errorf("il not *ast.IntegerLiteral. got=%T", il)
@@ -1035,6 +1039,7 @@ func testIntegerLiteral(t *testing.T, il ast.Expression, value int64) bool {
}
func testIdentifier(t *testing.T, exp ast.Expression, value string) bool {
+ t.Helper()
ident, ok := exp.(*ast.Identifier)
if !ok {
t.Errorf("exp not *ast.Identifier. got=%T", exp)
@@ -1056,6 +1061,7 @@ func testIdentifier(t *testing.T, exp ast.Expression, value string) bool {
}
func testBooleanLiteral(t *testing.T, exp ast.Expression, value bool) bool {
+ t.Helper()
bo, ok := exp.(*ast.Boolean)
if !ok {
t.Errorf("exp not *ast.Boolean. got=%T", exp)