public function testNot() { $falsy_cases = array(true, "string", 1); $truthy_cases = array(false, null, 0); var_dump(v\map('v\\not', $falsy_cases)); var_dump(v\map('v\\not', $truthy_cases)); $this->assertEquals(true, v\every(function ($x) { return !$x; }, v\map('v\\not', $falsy_cases))); $this->assertEquals(true, v\every(function ($x) { return $x; }, v\map('v\\not', $truthy_cases))); }
public function testProperties() { $this->assertTrue(v\every('v\\even', array(0, 2, 4, 6))); $this->assertTrue(v\every('v\\odd', array(1, 3, 5, 7))); }