Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90863337
PhutilSystemTestCase.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
Tue, Nov 5, 11:23
Size
1012 B
Mime Type
text/x-php
Expires
Thu, Nov 7, 11:23 (2 d)
Engine
blob
Format
Raw Data
Handle
22146907
Attached To
rPHU libphutil
PhutilSystemTestCase.php
View Options
<?php
final
class
PhutilSystemTestCase
extends
PhutilTestCase
{
public
function
testParseVMStat
()
{
$tests
=
array
(
'vmstat.yosemite.txt'
=>
array
(
'total'
=>
16503578624
,
'free'
=>
1732366336
,
),
);
$dir
=
dirname
(
__FILE__
).
'/memory'
;
foreach
(
$tests
as
$input
=>
$expect
)
{
$raw
=
Filesystem
::
readFile
(
$dir
.
'/'
.
$input
);
$actual
=
PhutilSystem
::
parseVMStat
(
$raw
);
$this
->
assertEqual
(
$expect
,
$actual
,
pht
(
'Parse of "%s".'
,
$input
));
}
}
public
function
testParseMeminfo
()
{
$tests
=
array
(
'meminfo.ubuntu14.txt'
=>
array
(
'total'
=>
7843336192
,
'free'
=>
3758297088
,
),
);
$dir
=
dirname
(
__FILE__
).
'/memory'
;
foreach
(
$tests
as
$input
=>
$expect
)
{
$raw
=
Filesystem
::
readFile
(
$dir
.
'/'
.
$input
);
$actual
=
PhutilSystem
::
parseMemInfo
(
$raw
);
$this
->
assertEqual
(
$expect
,
$actual
,
pht
(
'Parse of "%s".'
,
$input
));
}
}
}
Event Timeline
Log In to Comment