From 2b5d04959eadff62997750bffa6e8c9e1f06987d Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 12 May 2021 05:09:21 +0200 Subject: [PATCH] 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. --- tests/Core/Tokenizer/DoubleArrowTest.inc | 2 +- tests/Core/Tokenizer/DoubleArrowTest.php | 94 ++++++++++++------------ 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/tests/Core/Tokenizer/DoubleArrowTest.inc b/tests/Core/Tokenizer/DoubleArrowTest.inc index 3ca1025730..b67b066015 100644 --- a/tests/Core/Tokenizer/DoubleArrowTest.inc +++ b/tests/Core/Tokenizer/DoubleArrowTest.inc @@ -185,7 +185,7 @@ function matchShortArrayMismash() { } => match ($test) { /* testMatchArrowInComplexShortArrayValue1 */ 1 => [ /* testShortArrayArrowInComplexMatchValueinShortArrayValue */ 1 => 'a'], - /* testMatchArrowInComplexShortArrayValue1 */ + /* testMatchArrowInComplexShortArrayValue2 */ 2 => /* testFnArrowInComplexMatchValueInShortArrayValue */ fn($y) => callMe($y) }, ]; diff --git a/tests/Core/Tokenizer/DoubleArrowTest.php b/tests/Core/Tokenizer/DoubleArrowTest.php index 9a0b174c3c..ad1a411ff3 100644 --- a/tests/Core/Tokenizer/DoubleArrowTest.php +++ b/tests/Core/Tokenizer/DoubleArrowTest.php @@ -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() @@ -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 */'],