Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F105975378
PhutilDefaultSyntaxHighlighterEngineTestCase.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:42
Size
658 B
Mime Type
text/x-php
Expires
Sun, Mar 23, 05:42 (2 d)
Engine
blob
Format
Raw Data
Handle
25088769
Attached To
rPHU libphutil
PhutilDefaultSyntaxHighlighterEngineTestCase.php
View Options
<?php
/**
* Test cases for @{class:PhutilDefaultSyntaxHighlighterEngine}.
*
* @group testcase
*/
final
class
PhutilDefaultSyntaxHighlighterEngineTestCase
extends
PhutilTestCase
{
public
function
testFilenameGreediness
()
{
$names
=
array
(
'x.php'
=>
'php'
,
'/x.php'
=>
'php'
,
'x.y.php'
=>
'php'
,
'/x.y/z.php'
=>
'php'
,
'/x.php/'
=>
null
,
);
$engine
=
new
PhutilDefaultSyntaxHighlighterEngine
();
foreach
(
$names
as
$path
=>
$language
)
{
$detect
=
$engine
->
getLanguageFromFilename
(
$path
);
$this
->
assertEqual
(
$language
,
$detect
,
'Language detect for '
.
$path
);
}
}
}
Event Timeline
Log In to Comment