Replies: 2 comments
-
This is a good idea; the question is how should it be integrated. The backends are currently selected statically based on a |
Beta Was this translation helpful? Give feedback.
-
There are also platform-specific tools like https://github.com/martinpitt/umockdev that replay/mock USB traffic at the OS level. I've been meaning to look into those for testing nusb itself, but in theory you could use that via regular nusb to test your code. |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks for creating nusb. The simple API is great to use.
Now, about the Idea. I was thinking of maybe adding a new backend for unit-testing purposes, which works somewhat like the Static Replay Client from the AWS APIs.
It would just save outgoing transfers, which can then be asserted in a test and imitate/replay incoming transfers to elicit a reaction from the code under test.
(https://docs.rs/aws-smithy-runtime/latest/aws_smithy_runtime/client/http/test_util/struct.StaticReplayClient.html)
Would something like this fit into nusb?
Beta Was this translation helpful? Give feedback.
All reactions