Changeset View
Changeset View
Standalone View
Standalone View
src/parser/__tests__/ArcanistBundleTestCase.php
| Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | private function makeChangeAssertions($commit, array $raw_changes) { | ||||
| $changes = array(); | $changes = array(); | ||||
| // Verify that there are no duplicate changes, and rekey the changes on | // Verify that there are no duplicate changes, and rekey the changes on | ||||
| // affected path because we don't care about the order in which the | // affected path because we don't care about the order in which the | ||||
| // changes appear. | // changes appear. | ||||
| foreach ($raw_changes as $change) { | foreach ($raw_changes as $change) { | ||||
| $this->assertTrue( | $this->assertTrue( | ||||
| empty($changes[$change->getCurrentPath()]), | empty($changes[$change->getCurrentPath()]), | ||||
| "Unique Path: ".$change->getCurrentPath()); | 'Unique Path: '.$change->getCurrentPath()); | ||||
| $changes[$change->getCurrentPath()] = $change; | $changes[$change->getCurrentPath()] = $change; | ||||
| } | } | ||||
| switch ($commit) { | switch ($commit) { | ||||
| case '1830a13adf764b55743f7edc6066451898d8ffa4': | case '1830a13adf764b55743f7edc6066451898d8ffa4': | ||||
| // "Mark koan2 as +x and edit it." | // "Mark koan2 as +x and edit it." | ||||
| $this->assertEqual(1, count($changes)); | $this->assertEqual(1, count($changes)); | ||||
| ▲ Show 20 Lines • Show All 402 Lines • ▼ Show 20 Lines | switch ($commit) { | ||||
| $c->getType()); | $c->getType()); | ||||
| $this->assertEqual( | $this->assertEqual( | ||||
| ArcanistDiffChangeType::FILE_TEXT, | ArcanistDiffChangeType::FILE_TEXT, | ||||
| $c->getFileType()); | $c->getFileType()); | ||||
| break; | break; | ||||
| case '228d7be4840313ed805c25c15bba0f7b188af3e6': | case '228d7be4840313ed805c25c15bba0f7b188af3e6': | ||||
| // "Add a text file." | // "Add a text file." | ||||
| // This commit is never reached because we skip the 0th commit junk. | // This commit is never reached because we skip the 0th commit junk. | ||||
| $this->assertTrue(true, "This is never reached."); | $this->assertTrue(true, 'This is never reached.'); | ||||
| break; | break; | ||||
| default: | default: | ||||
| throw new Exception( | throw new Exception( | ||||
| "Commit {$commit} has no change assertions!"); | "Commit {$commit} has no change assertions!"); | ||||
| } | } | ||||
| } | } | ||||
| public function testTrailingContext() { | public function testTrailingContext() { | ||||
| ▲ Show 20 Lines • Show All 332 Lines • Show Last 20 Lines | |||||