Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debounce behaving weirdly in proposed unit test #299

Open
pyrtsa opened this issue Sep 29, 2023 · 0 comments
Open

Debounce behaving weirdly in proposed unit test #299

pyrtsa opened this issue Sep 29, 2023 · 0 comments

Comments

@pyrtsa
Copy link

pyrtsa commented Sep 29, 2023

I'd like to propose this additional unit test for debounce, which I think should be fixed before the final 1.0.0 release:

  func test_debounce() throws {
    guard #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) else { throw XCTSkip("Skipped due to Clock/Instant/Duration availability") }
    validate {
      "ab--cd-e-f---gh|"
      $0.inputs[0].debounce(for: .steps(3), clock: $0.clock)
      "------------f--[h|]"
    }
  }

The test currently fails as:

failed - Validation failure:
Expected:
------------f--[h|]
Actual:
----b-------c--[dh|]

That actual output can't possibly be right, can it?

Side note, if it helps to debug this…

Curiously, the test passes if only slightly tweaking the input:

-"ab--cd-e-f---gh|"
+"ab-c-d-e-f---gh|"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant