Skip to content

Commit

Permalink
follow up
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusFreitag committed Oct 31, 2023
1 parent 7ca9f3d commit 1423a9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,17 +443,17 @@ func TestIfExpression(t *testing.T) {
t.Fatalf("stmt.Expression is not ast.IfExpression. got=%T", stmt.Expression)
}

if !testInfix(t, exp.Condition, "x", "<", "y") {
if !testInfix(t, exp.ConConPairs[0].Condition, "x", "<", "y") {
return
}

if len(exp.Consequence.Statements) != 1 {
if len(exp.ConConPairs[0].Consequence.Statements) != 1 {
t.Errorf("consequence is not 1 statements. got=%d\n", len(program.Statements))
}

consequence, ok := exp.Consequence.Statements[0].(*ast.ExpressionStatement)
consequence, ok := exp.ConConPairs[0].Consequence.Statements[0].(*ast.ExpressionStatement)
if !ok {
t.Fatalf("Statements[0] is not ast.ExpressionStatement. got=%T", exp.Consequence.Statements[0])
t.Fatalf("Statements[0] is not ast.ExpressionStatement. got=%T", exp.ConConPairs[0].Consequence.Statements[0])
}

if !testIdentifier(t, consequence.Expression, "x") {
Expand Down

0 comments on commit 1423a9e

Please sign in to comment.