From 22c92256406f5d15fdbaaebac407e0ac7844c0a5 Mon Sep 17 00:00:00 2001 From: Sergey Solovyev Date: Thu, 15 Dec 2011 16:10:32 +0400 Subject: [PATCH] test --- .../calculator/model/CalculatorEngineTest.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/solovyev/android/calculator/model/CalculatorEngineTest.java b/src/test/java/org/solovyev/android/calculator/model/CalculatorEngineTest.java index 0c19af30..6df6d2ca 100644 --- a/src/test/java/org/solovyev/android/calculator/model/CalculatorEngineTest.java +++ b/src/test/java/org/solovyev/android/calculator/model/CalculatorEngineTest.java @@ -388,16 +388,18 @@ public class CalculatorEngineTest { Assert.assertEquals("1 446 257 064 651.832", cm.evaluate(JsclOperation.numeric, "28*28 * sin(28) - 0b:1101 + √(28) + exp ( 28) ").getResult()); Assert.assertEquals("13", cm.evaluate(JsclOperation.numeric, "0b:1101").getResult()); + try { + cm.evaluate(JsclOperation.numeric, "0b:π").getResult(); + Assert.fail(); + } catch (CalculatorParseException e) { + // ok + } + final NumeralBase defaultNumeralBase = cm.getEngine().getNumeralBase(); try{ cm.getEngine().setNumeralBase(NumeralBase.bin); Assert.assertEquals("101", cm.evaluate(JsclOperation.numeric, "10+11").getResult()); - try { - cm.evaluate(JsclOperation.numeric, "10/11"); - fail(); - } catch (CalculatorEvalException e) { - // ok - } + Assert.assertEquals("10/11", cm.evaluate(JsclOperation.numeric, "10/11").getResult()); cm.getEngine().setNumeralBase(NumeralBase.hex); Assert.assertEquals("63 7B", cm.evaluate(JsclOperation.numeric, "56CE+CAD").getResult());