예제 #1
0
 /**
  * This method tests the "split" method.
  *
  * @dataProvider data_split
  */
 public function test_split(array $provided, array $expected)
 {
     if (is_array($provided[1])) {
         $p0 = IRegex\Module::split(IRegex\Type::box($provided[0]), ITuple\Type::box2(IString\Type::box($provided[1][0]), IInt32\Type::box($provided[1][1])));
     } else {
         $p0 = IRegex\Module::split(IRegex\Type::box($provided[0]), IString\Type::box($provided[1]));
     }
     $e0 = $expected[0];
     $this->assertInstanceOf('\\Saber\\Data\\IArrayList\\Type', $p0);
     $this->assertSame($e0, $p0->unbox(1));
 }
예제 #2
0
 /**
  * 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);
 }