Skip to content

Commit

Permalink
[+]: added tests for "UTF8::strnatcmp()"
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Moelleken committed Feb 22, 2015
1 parent 5f92894 commit 7d3d73f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/UTF8Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1272,9 +1272,24 @@ public function testChrSizeList()

public function testStrnatcasecmp()
{
$this->assertEquals(0, UTF8::strnatcasecmp("Hello world 中文空白!", "Hello WORLD 中文空白!"));
$this->assertEquals(1, UTF8::strnatcasecmp("Hello world 中文空白!", "Hello WORLD 中文空白"));
$this->assertEquals(-1, UTF8::strnatcasecmp("Hello world 中文空白", "Hello WORLD 中文空白!"));
$this->assertEquals(-1, UTF8::strnatcasecmp("2Hello world 中文空白!", "10Hello WORLD 中文空白!"));
$this->assertEquals(1, UTF8::strnatcasecmp("10Hello world 中文空白!", "2Hello WORLD 中文空白!"));
$this->assertEquals(0, UTF8::strnatcasecmp("10Hello world 中文空白!", "10Hello world 中文空白!"));
$this->assertEquals(0, UTF8::strnatcasecmp("Hello world 中文空白!", "Hello WORLD 中文空白!"));
}

public function testStrnatcmp()
{
$this->assertEquals(1, UTF8::strnatcmp("Hello world 中文空白!", "Hello WORLD 中文空白!"));
$this->assertEquals(1, UTF8::strnatcmp("Hello world 中文空白!", "Hello WORLD 中文空白"));
$this->assertEquals(1, UTF8::strnatcmp("Hello world 中文空白", "Hello WORLD 中文空白!"));
$this->assertEquals(-1, UTF8::strnatcmp("2Hello world 中文空白!", "10Hello WORLD 中文空白!"));
$this->assertEquals(1, UTF8::strnatcmp("10Hello world 中文空白!", "2Hello WORLD 中文空白!"));
$this->assertEquals(0, UTF8::strnatcmp("10Hello world 中文空白!", "10Hello world 中文空白!"));
$this->assertEquals(1, UTF8::strnatcmp("Hello world 中文空白!", "Hello WORLD 中文空白!"));
}

public function testWordCount()
Expand Down

0 comments on commit 7d3d73f

Please sign in to comment.