Permalink
Browse files

Tests WIP.

  • Loading branch information...
1 parent 8151129 commit 80e57ed164587442a6cb78a5ea9001ea903561e0 @alexarnon committed Sep 20, 2011
Showing with 22 additions and 9 deletions.
  1. +0 −9 test/com/tmp/uint/functions/DataTests.java
  2. +22 −0 test/com/tmp/uint/functions/OutputTests.java
@@ -34,15 +34,6 @@ public void testList() {
}
@Test
- public void testPrint() {
- Assert.assertEquals("", new Runner().eval(new Expression(new Print())));
- Assert.assertEquals("xxx", new Runner().eval(new Expression(new Print(), "xxx")));
- Assert.assertEquals("xxx2", new Runner().eval(new Expression(new Print(), "xxx", new Expression(new Two()))));
- Assert.assertEquals("xxx25", new Runner().eval(new Expression(new Print(),
- "xxx", new Expression(new Two()), new Expression(new Plus(), 3, new Expression(new Two())))));
- }
-
- @Test
public void testUsage() {
Assert.assertTrue(new List().getUsage().startsWith("list"));
Assert.assertEquals(new List().getUsage(), new Runner().eval(new Expression(new Usage(), new List())));
@@ -0,0 +1,22 @@
+package com.tmp.uint.functions;
+
+import com.tmp.uint.core.Expression;
+import com.tmp.uint.core.Runner;
+import com.tmp.uint.functions.arithmetic.Plus;
+import com.tmp.uint.functions.arithmetic.Two;
+import com.tmp.uint.functions.output.Print;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class OutputTests {
+
+ @Test
+ public void testPrint() {
+ Assert.assertEquals("", new Runner().eval(new Expression(new Print())));
+ Assert.assertEquals("xxx", new Runner().eval(new Expression(new Print(), "xxx")));
+ Assert.assertEquals("xxx2", new Runner().eval(new Expression(new Print(), "xxx", new Expression(new Two()))));
+ Assert.assertEquals("xxx25", new Runner().eval(new Expression(new Print(),
+ "xxx", new Expression(new Two()), new Expression(new Plus(), 3, new Expression(new Two())))));
+ }
+
+}

0 comments on commit 80e57ed

Please sign in to comment.