A few test cases were added for CASE

This commit is contained in:
Mike Cifelli 2017-02-28 15:07:37 -05:00
parent ab17d4c60e
commit 4253145383
1 changed files with 14 additions and 0 deletions

View File

@ -67,6 +67,20 @@ public class CASETester {
assertSExpressionsMatch(parseString("nil"), evaluateString(input));
}
@Test
public void caseWithSeveralItemsInKeyList_Match() {
String input = "(case :a ((:b :a) 'orange) ((:c :d) 'banana))";
assertSExpressionsMatch(parseString("orange"), evaluateString(input));
}
@Test
public void caseWithSeveralItemsInKeyList_NoMatch() {
String input = "(case :a ((:b :f) 'orange) ((:c :d) 'banana))";
assertSExpressionsMatch(parseString("nil"), evaluateString(input));
}
@Test
public void caseWithSymbolicKeyList_Match() {
String input = "(case :a (:a 'orange))";