forth wizard / stack juggler

This commit is contained in:
zeroflag 2021-08-08 11:27:24 +02:00
parent f6de8fd687
commit d77add81df

View file

@ -12,9 +12,10 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import static com.vectron.fcl.types.Num.ONE; import static com.vectron.fcl.types.Num.ONE;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList; import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
public class JugglerTest { public class JugglerTest {
@ -28,7 +29,7 @@ public class JugglerTest {
@Test @Test
public void testSame() { public void testSame() {
assertTrue(solve(asList(ONE), asList(ONE)).isEmpty()); assertTrue(solve(singletonList(ONE), singletonList(ONE)).isEmpty());
} }
@Test @Test
@ -197,7 +198,7 @@ public class JugglerTest {
private void assertSolution(String expected, String input, String output) { private void assertSolution(String expected, String input, String output) {
if (expected == null) if (expected == null)
assertEquals(null, solve(parse(input), parse(output))); assertNull(solve(parse(input), parse(output)));
else else
assertEquals(Arrays.asList(expected.split(" ")), solve(parse(input), parse(output))); assertEquals(Arrays.asList(expected.split(" ")), solve(parse(input), parse(output)));
} }