/** * This method tests the "min" method. * * @dataProvider data_min */ public function test_min(array $provided, array $expected) { $p0 = IRegex\Module::min(IRegex\Type::box($provided[0]), IRegex\Type::box($provided[1])); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\IRegex\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }
/** * This method compares the specified object with the current object for order. * * @access public * @static * @param IRegex\Type $xs the left operand * @param IRegex\Type $ys the object to be compared * @return ITrit\Type whether the current object is less than, * equal to, or greater than the specified * object */ public static function compare(IRegex\Type $xs, IRegex\Type $ys) : ITrit\Type { return ITrit\Type::make(strcmp($xs->unbox(), $ys->unbox())); }
/** * This method tests the "toString" method. * * @dataProvider data_toString */ public function test_toString(array $provided, array $expected) { $p0 = IRegex\Type::box($provided[0])->toString(); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\IString\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }
/** * This method returns an array list of substrings that were delimited by a whitespace * character. * * @access public * @static * @param IString\Type $xs the left operand * @return IArrayList\Type an array list of substrings */ public static function words(IString\Type $xs) { return IRegex\Module::split(IRegex\Type::box('/\\s+/'), $xs); }