Move testcase file to right place
Test Plan: `arc unit`, see test name in list. Reviewers: chad, epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16915
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorTypeaheadDatasourceTestCase
|
||||
extends PhabricatorTestCase {
|
||||
|
||||
public function testTypeaheadTokenization() {
|
||||
$this->assertTokenization(
|
||||
'The quick brown fox',
|
||||
array('the', 'quick', 'brown', 'fox'));
|
||||
|
||||
$this->assertTokenization(
|
||||
'Quack quack QUACK',
|
||||
array('quack'));
|
||||
|
||||
$this->assertTokenization(
|
||||
'',
|
||||
array());
|
||||
|
||||
$this->assertTokenization(
|
||||
' [ - ] ',
|
||||
array());
|
||||
|
||||
$this->assertTokenization(
|
||||
'jury-rigged',
|
||||
array('jury', 'rigged'));
|
||||
|
||||
$this->assertTokenization(
|
||||
'[[ brackets ]] [-] ]-[ tie-fighters',
|
||||
array('brackets', 'tie', 'fighters'));
|
||||
}
|
||||
|
||||
private function assertTokenization($input, $expect) {
|
||||
$this->assertEqual(
|
||||
$expect,
|
||||
PhabricatorTypeaheadDatasource::tokenizeString($input),
|
||||
pht('Tokenization of "%s"', $input));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user