Motivation
I have a test case where there are a ton of I²C writes which I don't care about in this specific test. I still want to mock execute them but the data written is not relevant.
Implementation
I have some ideas how this could be implemented.
-
The impl Transaction block 1 could be extended with a function write_ignore then either implemented by extending the enum Mode2 with WriteIgnore or a new field in the Transaction struct3
-
Another way would be to add an option to write()4 but that would break all tests for every user of the I²C whether they want this feature or not, so I don't think that is the path forward.
-
The same builder style interface as with_error5 could be used to modify Transaction
- Are there any negative implications I did not consider?
- Any preferred implementation style?
Motivation
I have a test case where there are a ton of I²C writes which I don't care about in this specific test. I still want to mock execute them but the data written is not relevant.
Implementation
I have some ideas how this could be implemented.
The
impl Transactionblock 1 could be extended with a functionwrite_ignorethen either implemented by extending the enumMode2 withWriteIgnoreor a new field in theTransactionstruct3Another way would be to add an option to
write()4 but that would break all tests for every user of the I²C whether they want this feature or not, so I don't think that is the path forward.The same builder style interface as
with_error5 could be used to modifyTransaction