Skip to content

Commit 2b5d049

Browse files
committed
DoubleArrowTest: minor bug fix
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.
1 parent fde816c commit 2b5d049

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

tests/Core/Tokenizer/DoubleArrowTest.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function matchShortArrayMismash() {
185185
} => match ($test) {
186186
/* testMatchArrowInComplexShortArrayValue1 */
187187
1 => [ /* testShortArrayArrowInComplexMatchValueinShortArrayValue */ 1 => 'a'],
188-
/* testMatchArrowInComplexShortArrayValue1 */
188+
/* testMatchArrowInComplexShortArrayValue2 */
189189
2 => /* testFnArrowInComplexMatchValueInShortArrayValue */ fn($y) => callMe($y)
190190
},
191191
];

tests/Core/Tokenizer/DoubleArrowTest.php

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -50,52 +50,52 @@ public function testDoubleArrow($testMarker)
5050
public function dataDoubleArrow()
5151
{
5252
return [
53-
'simple_long_array' => ['/* testLongArrayArrowSimple */'],
54-
'simple_short_array' => ['/* testShortArrayArrowSimple */'],
55-
'simple_long_list' => ['/* testLongListArrowSimple */'],
56-
'simple_short_list' => ['/* testShortListArrowSimple */'],
57-
'simple_yield' => ['/* testYieldArrowSimple */'],
58-
'simple_foreach' => ['/* testForeachArrowSimple */'],
59-
60-
'long_array_with_match_value_1' => ['/* testLongArrayArrowWithNestedMatchValue1 */'],
61-
'long_array_with_match_value_2' => ['/* testLongArrayArrowWithNestedMatchValue2 */'],
62-
'short_array_with_match_value_1' => ['/* testShortArrayArrowWithNestedMatchValue1 */'],
63-
'short_array_with_match_value_2' => ['/* testShortArrayArrowWithNestedMatchValue2 */'],
64-
65-
'long_array_with_match_key' => ['/* testLongArrayArrowWithMatchKey */'],
66-
'short_array_with_match_key' => ['/* testShortArrayArrowWithMatchKey */'],
67-
68-
'long_array_in_match_body_1' => ['/* testLongArrayArrowInMatchBody1 */'],
69-
'long_array_in_match_body_2' => ['/* testLongArrayArrowInMatchBody2 */'],
70-
'long_array_in_match_body_2' => ['/* testLongArrayArrowInMatchBody3 */'],
71-
'short_array_in_match_body_1' => ['/* testShortArrayArrowInMatchBody1 */'],
72-
'short_array_in_match_body_2' => ['/* testShortArrayArrowInMatchBody2 */'],
73-
'short_array_in_match_body_2' => ['/* testShortArrayArrowInMatchBody3 */'],
74-
75-
'short_array_in_match_case_1' => ['/* testShortArrayArrowinMatchCase1 */'],
76-
'short_array_in_match_case_2' => ['/* testShortArrayArrowinMatchCase2 */'],
77-
'short_array_in_match_case_3' => ['/* testShortArrayArrowinMatchCase3 */'],
78-
'long_array_in_match_case_4' => ['/* testLongArrayArrowinMatchCase4 */'],
79-
80-
'in_complex_short_array_key_match_value' => ['/* testShortArrayArrowInComplexMatchValueinShortArrayKey */'],
81-
'in_complex_short_array_toplevel' => ['/* testShortArrayArrowInComplexMatchArrayMismash */'],
82-
'in_complex_short_array_value_match_value' => ['/* testShortArrayArrowInComplexMatchValueinShortArrayValue */'],
83-
84-
'long_list_in_match_body' => ['/* testLongListArrowInMatchBody */'],
85-
'long_list_in_match_case' => ['/* testLongListArrowInMatchCase */'],
86-
'short_list_in_match_body' => ['/* testShortListArrowInMatchBody */'],
87-
'short_list_in_match_case' => ['/* testShortListArrowInMatchCase */'],
88-
'long_list_with_match_in_key' => ['/* testLongListArrowWithMatchInKey */'],
89-
'short_list_with_match_in_key' => ['/* testShortListArrowWithMatchInKey */'],
90-
91-
'long_array_with_constant_default_in_key' => ['/* testLongArrayArrowWithClassConstantKey */'],
92-
'short_array_with_constant_default_in_key' => ['/* testShortArrayArrowWithClassConstantKey */'],
93-
'yield_with_constant_default_in_key' => ['/* testYieldArrowWithClassConstantKey */'],
94-
95-
'long_array_with_default_in_key_in_match' => ['/* testLongArrayArrowWithClassConstantKeyNestedInMatch */'],
96-
'short_array_with_default_in_key_in_match' => ['/* testShortArrayArrowWithClassConstantKeyNestedInMatch */'],
97-
'long_array_with_default_in_key_with_match' => ['/* testLongArrayArrowWithClassConstantKeyWithNestedMatch */'],
98-
'long_array_with_default_in_key_with_match' => ['/* testShortArrayArrowWithClassConstantKeyWithNestedMatch */'],
53+
'simple_long_array' => ['/* testLongArrayArrowSimple */'],
54+
'simple_short_array' => ['/* testShortArrayArrowSimple */'],
55+
'simple_long_list' => ['/* testLongListArrowSimple */'],
56+
'simple_short_list' => ['/* testShortListArrowSimple */'],
57+
'simple_yield' => ['/* testYieldArrowSimple */'],
58+
'simple_foreach' => ['/* testForeachArrowSimple */'],
59+
60+
'long_array_with_match_value_1' => ['/* testLongArrayArrowWithNestedMatchValue1 */'],
61+
'long_array_with_match_value_2' => ['/* testLongArrayArrowWithNestedMatchValue2 */'],
62+
'short_array_with_match_value_1' => ['/* testShortArrayArrowWithNestedMatchValue1 */'],
63+
'short_array_with_match_value_2' => ['/* testShortArrayArrowWithNestedMatchValue2 */'],
64+
65+
'long_array_with_match_key' => ['/* testLongArrayArrowWithMatchKey */'],
66+
'short_array_with_match_key' => ['/* testShortArrayArrowWithMatchKey */'],
67+
68+
'long_array_in_match_body_1' => ['/* testLongArrayArrowInMatchBody1 */'],
69+
'long_array_in_match_body_2' => ['/* testLongArrayArrowInMatchBody2 */'],
70+
'long_array_in_match_body_3' => ['/* testLongArrayArrowInMatchBody3 */'],
71+
'short_array_in_match_body_1' => ['/* testShortArrayArrowInMatchBody1 */'],
72+
'short_array_in_match_body_2' => ['/* testShortArrayArrowInMatchBody2 */'],
73+
'short_array_in_match_body_3' => ['/* testShortArrayArrowInMatchBody3 */'],
74+
75+
'short_array_in_match_case_1' => ['/* testShortArrayArrowinMatchCase1 */'],
76+
'short_array_in_match_case_2' => ['/* testShortArrayArrowinMatchCase2 */'],
77+
'short_array_in_match_case_3' => ['/* testShortArrayArrowinMatchCase3 */'],
78+
'long_array_in_match_case_4' => ['/* testLongArrayArrowinMatchCase4 */'],
79+
80+
'in_complex_short_array_key_match_value' => ['/* testShortArrayArrowInComplexMatchValueinShortArrayKey */'],
81+
'in_complex_short_array_toplevel' => ['/* testShortArrayArrowInComplexMatchArrayMismash */'],
82+
'in_complex_short_array_value_match_value' => ['/* testShortArrayArrowInComplexMatchValueinShortArrayValue */'],
83+
84+
'long_list_in_match_body' => ['/* testLongListArrowInMatchBody */'],
85+
'long_list_in_match_case' => ['/* testLongListArrowInMatchCase */'],
86+
'short_list_in_match_body' => ['/* testShortListArrowInMatchBody */'],
87+
'short_list_in_match_case' => ['/* testShortListArrowInMatchCase */'],
88+
'long_list_with_match_in_key' => ['/* testLongListArrowWithMatchInKey */'],
89+
'short_list_with_match_in_key' => ['/* testShortListArrowWithMatchInKey */'],
90+
91+
'long_array_with_constant_default_in_key' => ['/* testLongArrayArrowWithClassConstantKey */'],
92+
'short_array_with_constant_default_in_key' => ['/* testShortArrayArrowWithClassConstantKey */'],
93+
'yield_with_constant_default_in_key' => ['/* testYieldArrowWithClassConstantKey */'],
94+
95+
'long_array_with_default_in_key_in_match' => ['/* testLongArrayArrowWithClassConstantKeyNestedInMatch */'],
96+
'short_array_with_default_in_key_in_match' => ['/* testShortArrayArrowWithClassConstantKeyNestedInMatch */'],
97+
'long_array_with_default_in_key_with_match' => ['/* testLongArrayArrowWithClassConstantKeyWithNestedMatch */'],
98+
'short_array_with_default_in_key_with_match' => ['/* testShortArrayArrowWithClassConstantKeyWithNestedMatch */'],
9999
];
100100

101101
}//end dataDoubleArrow()
@@ -170,7 +170,7 @@ public function dataMatchArrow()
170170
'in_complex_short_array_key_1' => ['/* testMatchArrowInComplexShortArrayKey1 */'],
171171
'in_complex_short_array_key_2' => ['/* testMatchArrowInComplexShortArrayKey2 */'],
172172
'in_complex_short_array_value_1' => ['/* testMatchArrowInComplexShortArrayValue1 */'],
173-
'in_complex_short_array_key_2' => ['/* testMatchArrowInComplexShortArrayValue1 */'],
173+
'in_complex_short_array_value_2' => ['/* testMatchArrowInComplexShortArrayValue2 */'],
174174

175175
'with_long_list_in_body' => ['/* testMatchArrowWithLongListBody */'],
176176
'with_long_list_in_case' => ['/* testMatchArrowWithLongListInCase */'],

0 commit comments

Comments
 (0)