Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F112283720
PhutilRopeTestCase.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, May 9, 15:38
Size
582 B
Mime Type
text/x-php
Expires
Sun, May 11, 15:38 (2 d)
Engine
blob
Format
Raw Data
Handle
26050999
Attached To
rPHU libphutil
PhutilRopeTestCase.php
View Options
<?php
final
class
PhutilRopeTestCase
extends
PhutilTestCase
{
public
function
testRopeOperations
()
{
$rope
=
new
PhutilRope
();
$rope
->
append
(
'aaa'
);
$rope
->
append
(
'bbb'
);
$this
->
assertEqual
(
6
,
$rope
->
getByteLength
());
$this
->
assertEqual
(
'aaabbb'
,
$rope
->
getAsString
());
$rope
->
removeBytesFromHead
(
2
);
$this
->
assertEqual
(
4
,
$rope
->
getByteLength
());
$this
->
assertEqual
(
'abbb'
,
$rope
->
getAsString
());
$rope
->
removeBytesFromHead
(
4
);
$this
->
assertEqual
(
0
,
$rope
->
getByteLength
());
$this
->
assertEqual
(
''
,
$rope
->
getAsString
());
}
}
Event Timeline
Log In to Comment