Skip to content

Commit 71bf7a7

Browse files
Added tests for cli/safe_substr()
1 parent 4d67f6e commit 71bf7a7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/test-cli.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ function test_encoded_string_length() {
2424

2525
}
2626

27+
function test_encoded_substr() {
28+
29+
$this->assertEquals( \cli\safe_substr( \cli\Colors::pad( 'hello', 0, 2 ) ), 'he' );
30+
$this->assertEquals( \cli\safe_substr( \cli\Colors::pad( 'óra' , 0, 2 ) ), 'ór' );
31+
32+
}
33+
2734
function test_colorized_string_length() {
2835
$this->assertEquals( \cli\Colors::length( \cli\Colors::colorize( '%Gx%n', true ) ), 1 );
2936
}

0 commit comments

Comments
 (0)