@Test
public void cons() {
LObject o;
o = cons.run(environment, new DefaultParser().parse("(1 2)"));
Assert.assertEquals("'(1 . 2)", o.toString());
Assert.assertTrue(o instanceof LTupel);
Assert.assertTrue(((LTupel) o).getFirst() instanceof LNumber);
Assert.assertTrue(((LTupel) o).getRest() instanceof LNumber);
o = cons.run(environment, new DefaultParser().parse("(1 null)"));
Assert.assertEquals("'(1)", o.toString());
Assert.assertTrue(o instanceof LTupel);
Assert.assertTrue(((LTupel) o).getFirst() instanceof LNumber);
Assert.assertTrue(((LTupel) o).getRest() instanceof LNull);
o = cons.run(environment, new DefaultParser().parse("(null 1)"));
Assert.assertEquals("'(() . 1)", o.toString());
Assert.assertTrue(o instanceof LTupel);
Assert.assertTrue(((LTupel) o).getFirst() instanceof LNull);
Assert.assertTrue(((LTupel) o).getRest() instanceof LNumber);
o = cons.run(environment, new DefaultParser().parse("((cons 1 2) 3)"));
Assert.assertEquals("'((1 . 2) . 3)", o.toString());
Assert.assertTrue(o instanceof LTupel);
Assert.assertTrue(((LTupel) o).getFirst() instanceof LTupel);
Assert.assertTrue(((LTupel) o).getRest() instanceof LNumber);
}