/** * This method tests the "compare" method. * * @dataProvider data_compare */ public function test_compare(array $provided, array $expected) { $p0 = ITuple\Module::compare(ITuple\Type::make($provided[0], '\\Saber\\Data\\IInt32\\Type'), ITuple\Type::make($provided[1], '\\Saber\\Data\\IInt32\\Type')); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\ITrit\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }
/** * This method returns the numerically lowest value. * * @access public * @static * @param ITuple\Type $xs the left operand * @param ITuple\Type $ys the right operand * @return ITuple\Type the minimum value */ public static function min(ITuple\Type $xs, ITuple\Type $ys) : ITuple\Type { return ITuple\Module::compare($xs, $ys)->unbox() <= 0 ? $xs : $ys; }