Exemplo n.º 1
0
 public function test_cons()
 {
     $expected = new Cons("foo", new Cons("bar", new Cons("buz", null)));
     $actual = f::cons("foo", f::cons("bar", f::cons("buz", null)));
     $this->assertEquals($expected, $actual);
 }
Exemplo n.º 2
0
 public function test_functools_wrapper()
 {
     $f = function () {
     };
     $this->assertEquals(f::arity('explode'), _::arity('explode'));
     $this->assertEquals(f::tuple('hoge'), _::tuple('hoge'));
     $this->assertEquals(f::cons("a", "b"), _::cons("a", "b"));
     $this->assertEquals(f::curry($f), _::curry($f));
     $this->assertEquals(f::fix($f), _::fix($f, $f));
     $this->assertEquals(f::compose($f, $f), _::compose($f, $f));
 }