Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F105970738
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
Fri, Mar 21, 05:00
Size
507 B
Mime Type
text/x-php
Expires
Sun, Mar 23, 05:00 (2 d)
Engine
blob
Format
Raw Data
Handle
25052467
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