Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110135205
PhutilTsprintfTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Apr 24, 21:08
Size
507 B
Mime Type
text/x-php
Expires
Sat, Apr 26, 21:08 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25757493
Attached To
rPHU libphutil
PhutilTsprintfTestCase.php
View Options
<?php
final
class
PhutilTsprintfTestCase
extends
PhutilTestCase
{
public
function
testTsprintf
()
{
$this
->
assertEqual
(
'<NUL>'
,
(
string
)
tsprintf
(
'%s'
,
"
\0
"
));
$this
->
assertEqual
(
'<ESC>[31mred<ESC>[39m'
,
(
string
)
tsprintf
(
'%s'
,
"
\x
1B[31mred
\x
1B[39m"
));
$block
=
"1
\r\n
2
\r
3
\n
4"
;
$this
->
assertEqual
(
'1<CR><LF>2<CR>3<LF>4'
,
(
string
)
tsprintf
(
'%s'
,
$block
));
$this
->
assertEqual
(
"1
\r\n
2<CR>3
\n
4"
,
(
string
)
tsprintf
(
'%B'
,
$block
));
}
}
Event Timeline
Log In to Comment