Browse Source

Add a bunch more edge cases to ConditionTreeTest

Issue 1106

git-svn-id: http://svn.dmdirc.com/trunk@3884 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Chris Smith 16 years ago
parent
commit
7ce57885a1
1 changed files with 29 additions and 1 deletions
  1. 29
    1
      test/com/dmdirc/actions/ConditionTreeTest.java

+ 29
- 1
test/com/dmdirc/actions/ConditionTreeTest.java View File

@@ -152,6 +152,13 @@ public class ConditionTreeTest extends junit.framework.TestCase {
152 152
         assertNull(tree);
153 153
     }
154 154
     
155
+    @Test
156
+    public void testMismatchedBrackets2() {
157
+        final ConditionTree tree = ConditionTree.parseString("0)");
158
+        
159
+        assertNull(tree);
160
+    }    
161
+    
155 162
     @Test
156 163
     public void testMissingUnaryArg() {
157 164
         final ConditionTree tree = ConditionTree.parseString("!");
@@ -171,12 +178,33 @@ public class ConditionTreeTest extends junit.framework.TestCase {
171 178
         final ConditionTree tree = ConditionTree.parseString("0|");
172 179
         
173 180
         assertNull(tree);
174
-    }    
181
+    }
182
+    
183
+    @Test
184
+    public void testMissingBinaryArg2() {
185
+        final ConditionTree tree = ConditionTree.parseString("0|!");
186
+        
187
+        assertNull(tree);
188
+    }        
175 189
     
176 190
     @Test
177 191
     public void testNonExistantOp() {
178 192
         final ConditionTree tree = ConditionTree.parseString("0/1");
179 193
         
194
+        assertNull(tree);
195
+    }
196
+    
197
+    @Test
198
+    public void testNoopEvaluation() {
199
+        final ConditionTree tree = ConditionTree.parseString("");
200
+        
201
+        assertTrue(tree.evaluate(new boolean[]{true, false, true}));
202
+    }   
203
+    
204
+    @Test
205
+    public void testBracketedUnary() {
206
+        final ConditionTree tree = ConditionTree.parseString("(+)");
207
+        
180 208
         assertNull(tree);
181 209
     }    
182 210
     

Loading…
Cancel
Save