Changeset View
Changeset View
Standalone View
Standalone View
src/lint/renderer/__tests__/ArcanistConsoleLintRendererTestCase.php
Show First 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | foreach ($map as $key => $test_case) { | ||||
$actual, | $actual, | ||||
pht( | pht( | ||||
'Lint rendering for "%s".', | 'Lint rendering for "%s".', | ||||
$key)); | $key)); | ||||
} | } | ||||
} | } | ||||
private function readTestData($filename) { | private function readTestData($filename) { | ||||
$path = dirname(__FILE__).'/data/'.$filename; | $path = __DIR__.'/data/'.$filename; | ||||
$data = Filesystem::readFile($path); | $data = Filesystem::readFile($path); | ||||
// If we find "~~~" at the end of the file, get rid of it and any whitespace | // If we find "~~~" at the end of the file, get rid of it and any whitespace | ||||
// afterwards. This allows specifying data files with trailing empty | // afterwards. This allows specifying data files with trailing empty | ||||
// lines. | // lines. | ||||
$data = preg_replace('/~~~\s*\z/', '', $data); | $data = preg_replace('/~~~\s*\z/', '', $data); | ||||
// Trim "~" off the ends of lines. This allows the "expect" file to test | // Trim "~" off the ends of lines. This allows the "expect" file to test | ||||
// for trailing whitespace without actually containing trailing | // for trailing whitespace without actually containing trailing | ||||
// whitespace. | // whitespace. | ||||
$data = preg_replace('/~$/m', '', $data); | $data = preg_replace('/~$/m', '', $data); | ||||
return $data; | return $data; | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0