Skip to content

Commit

Permalink
Added another exponent test
Browse files Browse the repository at this point in the history
- tests 1 + 10^(2 * 3) * 5"
  • Loading branch information
Ed Murphy committed Oct 16, 2015
1 parent 29eb617 commit f1a8833
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/com/lumpofcode/expression/ExpressionParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,18 @@ public void testParseExponentiation()
assertEquals("1 + 10^-2 * 5", theExpression.format());
assertEquals("(1 + ((10^-2) * 5))", theExpression.formatFullParenthesis());

//
// exponents that are expressions
//
theExpression = ExpressionParser.parse(" 1 + 10^(2 * 3) * 5");
assertNotNull(theExpression);

System.out.println(theExpression.evaluate());

assertTrue(5000001 == theExpression.evaluate());
assertEquals("1 + 10^(2 * 3) * 5", theExpression.format());
assertEquals("(1 + ((10^(2 * 3)) * 5))", theExpression.formatFullParenthesis());

}

@Test
Expand Down

0 comments on commit f1a8833

Please sign in to comment.