From 1e31812f39ae0bfbeeaac0968f37720fada8a3a4 Mon Sep 17 00:00:00 2001 From: xuty Date: Sun, 29 Dec 2024 23:16:51 +0800 Subject: [PATCH] Add more tests --- Tests/ShaftTests/Gesture/TapAndDragTest.swift | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Tests/ShaftTests/Gesture/TapAndDragTest.swift b/Tests/ShaftTests/Gesture/TapAndDragTest.swift index e68e7d8..83bb730 100644 --- a/Tests/ShaftTests/Gesture/TapAndDragTest.swift +++ b/Tests/ShaftTests/Gesture/TapAndDragTest.swift @@ -333,4 +333,25 @@ class TapAndDragTest: XCTestCase { XCTAssertEqual(events, ["down#1", "up#1"]) } } + + func test_Recognizer_rejects_pointer_that_is_not_the_primary_one_FILO_before_acceptance() { + testGesture { [self] tester in + setUpTapAndPanGestureRecognizer() + + tapAndDrag.addPointer(event: down1) + tapAndDrag.addPointer(event: down2) + tester.closeArena(1) + tester.route(down1) + + tester.closeArena(2) + tester.route(down2) + + tester.route(up2) + GestureBinding.shared.gestureArena.sweep(2) + + tester.route(up1) + GestureBinding.shared.gestureArena.sweep(1) + XCTAssertEqual(events, ["down#1", "up#1"]) + } + } }