Skip to content

Commit

Permalink
Merge branch 'master' into #5/refactor
Browse files Browse the repository at this point in the history
Conflicts:
	src/main/java/pl/bgora/rpn/FunctionsCalculator.java
  • Loading branch information
bartgora committed Apr 8, 2016
2 parents 16064f6 + c9d2e9c commit f1e735d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,6 @@ pip-log.txt
#Mr Developer
.mr.developer.cfg

target/
target/
.idea
*.iml
9 changes: 0 additions & 9 deletions .idea/codeStyleSettings.xml

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pl.bgora</groupId>
<artifactId>RPNLibrary</artifactId>
<version>2.0</version>
<version>2.0.1</version>
<name>RPNLibrary</name>
<description>RPN Libray for Java.</description>
<build>
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/pl/bgora/CalculatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ public void testSinus() throws RPNException {
assertEquals(BigDecimal.valueOf(Math.sin(2)), result);
}

@Test
public void testOneAddWhiteSpaceSinus() throws RPNException {
BigDecimal result = calc.calculate("1 + sin(2)");
assertEquals(BigDecimal.valueOf(1+Math.sin(2)), result);
}

@Test
public void testSinusPlus() throws RPNException {
BigDecimal result = calc.calculate("sin(1+1)");
Expand Down Expand Up @@ -129,6 +135,12 @@ public void testCtgMinus5Zeros() throws RPNException {
assertEquals(BigDecimal.valueOf(1.00 / Math.tan(-1.65091)), result);
}

@Test
public void testAddTousands() throws RPNException {
BigDecimal result = calc.calculate("12 000 + 15");
assertEquals(BigDecimal.valueOf(12015), result);
}

@Test(expected = RPNException.class)
public void shouldThrowRPNException() throws RPNException {
calc.calculate("aaaaa");
Expand Down

0 comments on commit f1e735d

Please sign in to comment.