Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96107537
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
Sun, Dec 22, 16:14
Size
582 B
Mime Type
text/x-php
Expires
Tue, Dec 24, 16:14 (2 d)
Engine
blob
Format
Raw Data
Handle
23121515
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