1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Fix a spelling mistake and tidy up whitespace

Summary: Self-explanatory.

Test Plan: Eye-ball it.

Reviewers: epriestley, chad, #blessed_reviewers

Reviewed By: chad, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9705
This commit is contained in:
Joshua Spence 2014-06-24 15:09:53 +10:00
parent 108a4dc9e6
commit 439dff5e09

View file

@ -3,9 +3,7 @@
final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase { final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase {
public function testBasics() { public function testBasics() {
// Verify that the very basics of base commit resolution work. // Verify that the very basics of base commit resolution work.
$this->assertCommit( $this->assertCommit(
'Empty Rules', 'Empty Rules',
null, null,
@ -21,19 +19,17 @@ final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase {
} }
public function testResolutionOrder() { public function testResolutionOrder() {
// Rules should be resolved in order: args, local, project, global. These // Rules should be resolved in order: args, local, project, global. These
// test cases intentionally scramble argument order to test that resolution // test cases intentionally scramble argument order to test that resolution
// order is independent of argument order. // order is independent of argument order.
$this->assertCommit( $this->assertCommit(
'Order: Args', 'Order: Args',
'y', 'y',
array( array(
'local' => 'literal:n', 'local' => 'literal:n',
'project' => 'literal:n', 'project' => 'literal:n',
'runtime' => 'literal:y', 'runtime' => 'literal:y',
'user' => 'literal:n', 'user' => 'literal:n',
)); ));
$this->assertCommit( $this->assertCommit(
@ -42,7 +38,7 @@ final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase {
array( array(
'project' => 'literal:n', 'project' => 'literal:n',
'local' => 'literal:y', 'local' => 'literal:y',
'user' => 'literal:n', 'user' => 'literal:n',
)); ));
$this->assertCommit( $this->assertCommit(
@ -50,14 +46,14 @@ final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase {
'y', 'y',
array( array(
'project' => 'literal:y', 'project' => 'literal:y',
'user' => 'literal:n', 'user' => 'literal:n',
)); ));
$this->assertCommit( $this->assertCommit(
'Order: Global', 'Order: Global',
'y', 'y',
array( array(
'user' => 'literal:y', 'user' => 'literal:y',
)); ));
} }
@ -67,10 +63,10 @@ final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase {
'"global" name', '"global" name',
'y', 'y',
array( array(
'runtime' => 'arc:global, arc:halt', 'runtime' => 'arc:global, arc:halt',
'local' => 'arc:halt', 'local' => 'arc:halt',
'project' => 'arc:halt', 'project' => 'arc:halt',
'user' => 'literal:y', 'user' => 'literal:y',
)); ));
// 'args' should translate to 'runtime' // 'args' should translate to 'runtime'
@ -78,77 +74,67 @@ final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase {
'"args" name', '"args" name',
'y', 'y',
array( array(
'runtime' => 'arc:project, literal:y', 'runtime' => 'arc:project, literal:y',
'local' => 'arc:halt', 'local' => 'arc:halt',
'project' => 'arc:args', 'project' => 'arc:args',
'user' => 'arc:halt', 'user' => 'arc:halt',
)); ));
} }
public function testHalt() { public function testHalt() {
// 'arc:halt' should halt all processing. // 'arc:halt' should halt all processing.
$this->assertCommit( $this->assertCommit(
'Halt', 'Halt',
null, null,
array( array(
'runtime' => 'arc:halt', 'runtime' => 'arc:halt',
'local' => 'literal:xyz', 'local' => 'literal:xyz',
)); ));
} }
public function testYield() { public function testYield() {
// 'arc:yield' should yield to other rulesets. // 'arc:yield' should yield to other rulesets.
$this->assertCommit( $this->assertCommit(
'Yield', 'Yield',
'xyz', 'xyz',
array( array(
'runtime' => 'arc:yield, literal:abc', 'runtime' => 'arc:yield, literal:abc',
'local' => 'literal:xyz', 'local' => 'literal:xyz',
)); ));
// This one should return to 'runtime' after exhausting 'local'. // This one should return to 'runtime' after exhausting 'local'.
$this->assertCommit( $this->assertCommit(
'Yield + Return', 'Yield + Return',
'abc', 'abc',
array( array(
'runtime' => 'arc:yield, literal:abc', 'runtime' => 'arc:yield, literal:abc',
'local' => 'arc:skip', 'local' => 'arc:skip',
)); ));
} }
public function testJump() { public function testJump() {
// This should resolve to 'abc' without hitting any of the halts. // This should resolve to 'abc' without hitting any of the halts.
$this->assertCommit( $this->assertCommit(
'Jump', 'Jump',
'abc', 'abc',
array( array(
'runtime' => 'arc:project, arc:halt', 'runtime' => 'arc:project, arc:halt',
'local' => 'literal:abc', 'local' => 'literal:abc',
'project' => 'arc:user, arc:halt', 'project' => 'arc:user, arc:halt',
'user' => 'arc:local, arc:halt', 'user' => 'arc:local, arc:halt',
)); ));
} }
public function testJumpReturn() { public function testJumpReturn() {
// After jumping to project, we should return to 'runtime'. // After jumping to project, we should return to 'runtime'.
$this->assertCommit( $this->assertCommit(
'Jump Return', 'Jump Return',
'xyz', 'xyz',
array( array(
'runtime' => 'arc:project, literal:xyz', 'runtime' => 'arc:project, literal:xyz',
'local' => 'arc:halt', 'local' => 'arc:halt',
'project' => '', 'project' => '',
'user' => 'arc:halt', 'user' => 'arc:halt',
)); ));
} }
@ -158,9 +144,8 @@ final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase {
$this->assertEqual($commit, $result, $desc); $this->assertEqual($commit, $result, $desc);
} }
private function buildParser() { private function buildParser() {
// TODO: This is a little hacky beacuse we're using the Arcanist repository // TODO: This is a little hacky because we're using the Arcanist repository
// itself to execute tests with, but it should be OK until we get proper // itself to execute tests with, but it should be OK until we get proper
// isolation for repository-oriented test cases. // isolation for repository-oriented test cases.