Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
viktordanov committed Sep 26, 2022
1 parent ae23507 commit 4566d72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/abacus-cli/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ func Test_evaluateExpression(t *testing.T) {
{expr: "2", want: abacus.NewNumber(2), visitor: visitor},
{expr: "2.139487526 + 9.4777777", want: abacus.NewNumber(11.617265226), visitor: visitor},
}
expressionTests := testArgs{
{expr: "2", want: abacus.NewNumber(2), visitor: visitor},
{expr: "0.2", want: abacus.NewNumber(0.2), visitor: visitor},
{expr: ".2", want: abacus.NewNumber(0.2), visitor: visitor},
}
multiplicationTests := testArgs{
{expr: "2*2", want: abacus.NewNumber(4), visitor: visitor},
{expr: "2*2*2", want: abacus.NewNumber(8), visitor: visitor},
Expand Down Expand Up @@ -70,6 +75,7 @@ func Test_evaluateExpression(t *testing.T) {
}

runTestSuite(t, "Addition & Subtraction", additionTests)
runTestSuite(t, "Expressions", expressionTests)
runTestSuite(t, "Multiplication & Division", multiplicationTests)
runTestSuite(t, "Exponentiation", exponentiationTests)
runTestSuite(t, "Variables", variableTests)
Expand Down

0 comments on commit 4566d72

Please sign in to comment.