Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22423638
ArcanistSpellingLinterTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
989 B
Referenced Files
None
Subscribers
None
ArcanistSpellingLinterTestCase.php
View Options
<?php
/**
* Test cases for @{class:ArcanistSpellingLinter}.
*
* @group testcase
*/
final
class
ArcanistSpellingLinterTestCase
extends
ArcanistLinterTestCase
{
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
Sat, Nov 28, 03:36 (8 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1230209
Default Alt Text
ArcanistSpellingLinterTestCase.php (989 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline