Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/__tests__/ArcanistLinterTestCase.php
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | public function executeTestsInDirectory( | ||||
| $test_count = 0; | $test_count = 0; | ||||
| foreach ($files as $file) { | foreach ($files as $file) { | ||||
| $this->lintFile($root.$file, $linter); | $this->lintFile($root.$file, $linter); | ||||
| $test_count++; | $test_count++; | ||||
| } | } | ||||
| $this->assertTrue( | $this->assertTrue( | ||||
| ($test_count > 0), | ($test_count > 0), | ||||
| pht('Expected to find some .lint-test tests in directory %s!', $root)); | pht( | ||||
| 'Expected to find some %s tests in directory %s!', | |||||
| '.lint-test', | |||||
| $root)); | |||||
| } | } | ||||
| private function lintFile($file, ArcanistLinter $linter) { | private function lintFile($file, ArcanistLinter $linter) { | ||||
| $linter = clone $linter; | $linter = clone $linter; | ||||
| $contents = Filesystem::readFile($file); | $contents = Filesystem::readFile($file); | ||||
| $contents = preg_split('/^~{4,}\n/m', $contents); | $contents = preg_split('/^~{4,}\n/m', $contents); | ||||
| if (count($contents) < 2) { | if (count($contents) < 2) { | ||||
| ▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines | |||||