Skip to content

Commit

Permalink
Added tests for cli/safe_substr()
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseoverright committed Sep 7, 2014
1 parent 4d67f6e commit 71bf7a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ function test_encoded_string_length() {

}

function test_encoded_substr() {

$this->assertEquals( \cli\safe_substr( \cli\Colors::pad( 'hello', 0, 2 ) ), 'he' );
$this->assertEquals( \cli\safe_substr( \cli\Colors::pad( 'óra' , 0, 2 ) ), 'ór' );

}

function test_colorized_string_length() {
$this->assertEquals( \cli\Colors::length( \cli\Colors::colorize( '%Gx%n', true ) ), 1 );
}
Expand Down

0 comments on commit 71bf7a7

Please sign in to comment.