Skip to content

Commit

Permalink
DoubleArrowTest: minor bug fix
Browse files Browse the repository at this point in the history
The test case file contained one duplicate test marker and the actual test file contained a few duplicate array keys, which meant that a few cases weren't actually being tested.

Fixed now.

Note: the diff looks bigger than it really is due to the array arrow alignment. Best viewed while ignoring whitespace changes.
  • Loading branch information
jrfnl committed May 12, 2021
1 parent fde816c commit 2b5d049
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion tests/Core/Tokenizer/DoubleArrowTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function matchShortArrayMismash() {
} => match ($test) {
/* testMatchArrowInComplexShortArrayValue1 */
1 => [ /* testShortArrayArrowInComplexMatchValueinShortArrayValue */ 1 => 'a'],
/* testMatchArrowInComplexShortArrayValue1 */
/* testMatchArrowInComplexShortArrayValue2 */
2 => /* testFnArrowInComplexMatchValueInShortArrayValue */ fn($y) => callMe($y)
},
];
Expand Down
94 changes: 47 additions & 47 deletions tests/Core/Tokenizer/DoubleArrowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,52 +50,52 @@ public function testDoubleArrow($testMarker)
public function dataDoubleArrow()
{
return [
'simple_long_array' => ['/* testLongArrayArrowSimple */'],
'simple_short_array' => ['/* testShortArrayArrowSimple */'],
'simple_long_list' => ['/* testLongListArrowSimple */'],
'simple_short_list' => ['/* testShortListArrowSimple */'],
'simple_yield' => ['/* testYieldArrowSimple */'],
'simple_foreach' => ['/* testForeachArrowSimple */'],

'long_array_with_match_value_1' => ['/* testLongArrayArrowWithNestedMatchValue1 */'],
'long_array_with_match_value_2' => ['/* testLongArrayArrowWithNestedMatchValue2 */'],
'short_array_with_match_value_1' => ['/* testShortArrayArrowWithNestedMatchValue1 */'],
'short_array_with_match_value_2' => ['/* testShortArrayArrowWithNestedMatchValue2 */'],

'long_array_with_match_key' => ['/* testLongArrayArrowWithMatchKey */'],
'short_array_with_match_key' => ['/* testShortArrayArrowWithMatchKey */'],

'long_array_in_match_body_1' => ['/* testLongArrayArrowInMatchBody1 */'],
'long_array_in_match_body_2' => ['/* testLongArrayArrowInMatchBody2 */'],
'long_array_in_match_body_2' => ['/* testLongArrayArrowInMatchBody3 */'],
'short_array_in_match_body_1' => ['/* testShortArrayArrowInMatchBody1 */'],
'short_array_in_match_body_2' => ['/* testShortArrayArrowInMatchBody2 */'],
'short_array_in_match_body_2' => ['/* testShortArrayArrowInMatchBody3 */'],

'short_array_in_match_case_1' => ['/* testShortArrayArrowinMatchCase1 */'],
'short_array_in_match_case_2' => ['/* testShortArrayArrowinMatchCase2 */'],
'short_array_in_match_case_3' => ['/* testShortArrayArrowinMatchCase3 */'],
'long_array_in_match_case_4' => ['/* testLongArrayArrowinMatchCase4 */'],

'in_complex_short_array_key_match_value' => ['/* testShortArrayArrowInComplexMatchValueinShortArrayKey */'],
'in_complex_short_array_toplevel' => ['/* testShortArrayArrowInComplexMatchArrayMismash */'],
'in_complex_short_array_value_match_value' => ['/* testShortArrayArrowInComplexMatchValueinShortArrayValue */'],

'long_list_in_match_body' => ['/* testLongListArrowInMatchBody */'],
'long_list_in_match_case' => ['/* testLongListArrowInMatchCase */'],
'short_list_in_match_body' => ['/* testShortListArrowInMatchBody */'],
'short_list_in_match_case' => ['/* testShortListArrowInMatchCase */'],
'long_list_with_match_in_key' => ['/* testLongListArrowWithMatchInKey */'],
'short_list_with_match_in_key' => ['/* testShortListArrowWithMatchInKey */'],

'long_array_with_constant_default_in_key' => ['/* testLongArrayArrowWithClassConstantKey */'],
'short_array_with_constant_default_in_key' => ['/* testShortArrayArrowWithClassConstantKey */'],
'yield_with_constant_default_in_key' => ['/* testYieldArrowWithClassConstantKey */'],

'long_array_with_default_in_key_in_match' => ['/* testLongArrayArrowWithClassConstantKeyNestedInMatch */'],
'short_array_with_default_in_key_in_match' => ['/* testShortArrayArrowWithClassConstantKeyNestedInMatch */'],
'long_array_with_default_in_key_with_match' => ['/* testLongArrayArrowWithClassConstantKeyWithNestedMatch */'],
'long_array_with_default_in_key_with_match' => ['/* testShortArrayArrowWithClassConstantKeyWithNestedMatch */'],
'simple_long_array' => ['/* testLongArrayArrowSimple */'],
'simple_short_array' => ['/* testShortArrayArrowSimple */'],
'simple_long_list' => ['/* testLongListArrowSimple */'],
'simple_short_list' => ['/* testShortListArrowSimple */'],
'simple_yield' => ['/* testYieldArrowSimple */'],
'simple_foreach' => ['/* testForeachArrowSimple */'],

'long_array_with_match_value_1' => ['/* testLongArrayArrowWithNestedMatchValue1 */'],
'long_array_with_match_value_2' => ['/* testLongArrayArrowWithNestedMatchValue2 */'],
'short_array_with_match_value_1' => ['/* testShortArrayArrowWithNestedMatchValue1 */'],
'short_array_with_match_value_2' => ['/* testShortArrayArrowWithNestedMatchValue2 */'],

'long_array_with_match_key' => ['/* testLongArrayArrowWithMatchKey */'],
'short_array_with_match_key' => ['/* testShortArrayArrowWithMatchKey */'],

'long_array_in_match_body_1' => ['/* testLongArrayArrowInMatchBody1 */'],
'long_array_in_match_body_2' => ['/* testLongArrayArrowInMatchBody2 */'],
'long_array_in_match_body_3' => ['/* testLongArrayArrowInMatchBody3 */'],
'short_array_in_match_body_1' => ['/* testShortArrayArrowInMatchBody1 */'],
'short_array_in_match_body_2' => ['/* testShortArrayArrowInMatchBody2 */'],
'short_array_in_match_body_3' => ['/* testShortArrayArrowInMatchBody3 */'],

'short_array_in_match_case_1' => ['/* testShortArrayArrowinMatchCase1 */'],
'short_array_in_match_case_2' => ['/* testShortArrayArrowinMatchCase2 */'],
'short_array_in_match_case_3' => ['/* testShortArrayArrowinMatchCase3 */'],
'long_array_in_match_case_4' => ['/* testLongArrayArrowinMatchCase4 */'],

'in_complex_short_array_key_match_value' => ['/* testShortArrayArrowInComplexMatchValueinShortArrayKey */'],
'in_complex_short_array_toplevel' => ['/* testShortArrayArrowInComplexMatchArrayMismash */'],
'in_complex_short_array_value_match_value' => ['/* testShortArrayArrowInComplexMatchValueinShortArrayValue */'],

'long_list_in_match_body' => ['/* testLongListArrowInMatchBody */'],
'long_list_in_match_case' => ['/* testLongListArrowInMatchCase */'],
'short_list_in_match_body' => ['/* testShortListArrowInMatchBody */'],
'short_list_in_match_case' => ['/* testShortListArrowInMatchCase */'],
'long_list_with_match_in_key' => ['/* testLongListArrowWithMatchInKey */'],
'short_list_with_match_in_key' => ['/* testShortListArrowWithMatchInKey */'],

'long_array_with_constant_default_in_key' => ['/* testLongArrayArrowWithClassConstantKey */'],
'short_array_with_constant_default_in_key' => ['/* testShortArrayArrowWithClassConstantKey */'],
'yield_with_constant_default_in_key' => ['/* testYieldArrowWithClassConstantKey */'],

'long_array_with_default_in_key_in_match' => ['/* testLongArrayArrowWithClassConstantKeyNestedInMatch */'],
'short_array_with_default_in_key_in_match' => ['/* testShortArrayArrowWithClassConstantKeyNestedInMatch */'],
'long_array_with_default_in_key_with_match' => ['/* testLongArrayArrowWithClassConstantKeyWithNestedMatch */'],
'short_array_with_default_in_key_with_match' => ['/* testShortArrayArrowWithClassConstantKeyWithNestedMatch */'],
];

}//end dataDoubleArrow()
Expand Down Expand Up @@ -170,7 +170,7 @@ public function dataMatchArrow()
'in_complex_short_array_key_1' => ['/* testMatchArrowInComplexShortArrayKey1 */'],
'in_complex_short_array_key_2' => ['/* testMatchArrowInComplexShortArrayKey2 */'],
'in_complex_short_array_value_1' => ['/* testMatchArrowInComplexShortArrayValue1 */'],
'in_complex_short_array_key_2' => ['/* testMatchArrowInComplexShortArrayValue1 */'],
'in_complex_short_array_value_2' => ['/* testMatchArrowInComplexShortArrayValue2 */'],

'with_long_list_in_body' => ['/* testMatchArrowWithLongListBody */'],
'with_long_list_in_case' => ['/* testMatchArrowWithLongListInCase */'],
Expand Down

0 comments on commit 2b5d049

Please sign in to comment.