Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F67822310
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
Mon, Jun 24, 13:22
Size
582 B
Mime Type
text/x-php
Expires
Wed, Jun 26, 13:22 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18476982
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