package net.ciklum.icfpc11.domain.greenspoon10; import junit.framework.TestCase import net.ciklum.icfpc11.domain.Game /** * @author vic */ @Typed public class SCombinatorTest extends TestCase { void setUp() { Game.push() } void tearDown() { Game.pop() } void testCombinator() { Function s = new SCombinator() Function f = new KCombinator().apply(new Succ()) Function g = Identity.IDENTITY Function x = ConstantFunction.ZERO Function sf = s.apply(f) assertEquals "S(K(succ))", sf.toString() Function sfg = sf.apply(g) assertEquals "S(K(succ),I)", sfg.toString() //FIXME: Test more Function y = sfg.apply(x) assertEquals ConstantFunction.valueOf(1), y } }