public function test_it_should_sum_all_from_one_list_with_elements_from_second() { $listA = Listt::of([1, 2]); $listB = Listt::of([4, 5]); // sum <*> [1, 2] <*> [4, 5] $result = f\liftA2('example\\sum', $listA, $listB); $this->assertInstanceOf(Listt::class, $result); $this->assertEquals([5, 6, 6, 7], f\valueOf($result)); }
/** * @dataProvider provideData */ public function test_it_should_be_prepared_of_errors(array $request, $isError, $expected) { $result = handleRequest($request); $this->assertInstanceOf($isError ? E\Left::class : E\Right::class, $result); $this->assertEquals($expected, f\valueOf($result)); }