Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7862196
ArcanistSpellingLinterTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
999 B
Referenced Files
None
Subscribers
None
ArcanistSpellingLinterTestCase.php
View Options
<?php
/**
* Test cases for @{class:ArcanistSpellingLinter}.
*
* @group testcase
*/
final
class
ArcanistSpellingLinterTestCase
extends
ArcanistArcanistLinterTestCase
{
public
function
testSpellingLint
()
{
$linter
=
new
ArcanistSpellingLinter
();
$linter
->
removeLintRule
(
'acc'
.
'out'
);
$linter
->
addPartialWordRule
(
'supermn'
,
'superman'
);
$linter
->
addWholeWordRule
(
'batmn'
,
'batman'
);
$working_copy
=
ArcanistWorkingCopyIdentity
::
newFromPath
(
__FILE__
);
return
$this
->
executeTestsInDirectory
(
dirname
(
__FILE__
).
'/spelling/'
,
$linter
,
$working_copy
);
}
public
function
testFixLetterCase
()
{
$tests
=
array
(
'tst'
=>
'test'
,
'Tst'
=>
'Test'
,
'TST'
=>
'TEST'
,
'tSt'
=>
null
,
);
foreach
(
$tests
as
$case
=>
$expect
)
{
foreach
(
array
(
'test'
,
'TEST'
)
as
$string
)
{
$result
=
ArcanistSpellingLinter
::
fixLetterCase
(
$string
,
$case
);
$this
->
assertEqual
(
$expect
,
$result
,
$case
);
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 13, 20:16 (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
877025
Default Alt Text
ArcanistSpellingLinterTestCase.php (999 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment