@@ -47,6 +47,12 @@ function test_encoded_string_pad() {
4747 $ this ->assertEquals ( 6 , strlen ( \cli \Colors::pad ( 'hello ' , 6 , false , false , STR_PAD_RIGHT ) ) );
4848 $ this ->assertEquals ( 7 , strlen ( \cli \Colors::pad ( 'óra ' , 6 , false , false , STR_PAD_LEFT ) ) ); // special characters take one byte
4949 $ this ->assertEquals ( 9 , strlen ( \cli \Colors::pad ( '日本語 ' , 6 , false , false , STR_PAD_BOTH ) ) ); // each character takes two bytes
50+ $ this ->assertSame ( 4 , strpos ( \cli \Colors::pad ( 'hello ' , 10 , false , false , STR_PAD_RIGHT ), 'o ' ) );
51+ $ this ->assertSame ( 9 , strpos ( \cli \Colors::pad ( 'hello ' , 10 , false , false , STR_PAD_LEFT ), 'o ' ) );
52+ $ this ->assertSame ( 6 , strpos ( \cli \Colors::pad ( 'hello ' , 10 , false , false , STR_PAD_BOTH ), 'o ' ) );
53+ $ this ->assertSame ( 1 , strpos ( \cli \Colors::pad ( 'hello ' , 10 , false , false , STR_PAD_RIGHT ), 'e ' ) );
54+ $ this ->assertSame ( 6 , strpos ( \cli \Colors::pad ( 'hello ' , 10 , false , false , STR_PAD_LEFT ), 'e ' ) );
55+ $ this ->assertSame ( 3 , strpos ( \cli \Colors::pad ( 'hello ' , 10 , false , false , STR_PAD_BOTH ), 'e ' ) );
5056 }
5157
5258 function test_colorized_string_pad () {
0 commit comments