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

add SetDutyCycle mock #88

Merged
merged 1 commit into from
Nov 23, 2023
Merged

add SetDutyCycle mock #88

merged 1 commit into from
Nov 23, 2023

Conversation

rursprung
Copy link
Contributor

this is the 1.0 equivalent of the old PwmPin trait (the mock for this has been added in #52).

note that the test coverage is fully handled by the doc test which is why there's no additional mod test in this file.

this fixes #73

(note: this replaces #74 which was targeting the now defunct 1-alpha branch)

@rursprung
Copy link
Contributor Author

it seems that the format of the assertion message is now different in nightly? i.e. the failure seems to be unrelated...

       panic message: `"assertion `left == right` failed: i2c::write unexpected mode\n  left: Read\n right: Write"`,
 expected substring: `"assertion failed: `(left == right)`\n  left: `Read`,\n right: `Write`: i2c::write unexpected mode"`

(however, i have the very odd experience that without my PR it builds fine locally but with it it also fails with cargo +nightly test --all-features... i can't explain that right now 😕)

@dbrgn
Copy link
Owner

dbrgn commented Sep 14, 2023

Yeah, nightly apparently changed the assertion format. If we adapt to nightly, then tests on stable will fail.

I think I'll simply reduce the assertions to a smaller subset of the message.

@dbrgn
Copy link
Owner

dbrgn commented Sep 14, 2023

@rursprung should be fixed on main, could you rebase?

@rursprung
Copy link
Contributor Author

@rursprung should be fixed on main, could you rebase?

rebased, works fine now. thanks for fixing this!

@rursprung
Copy link
Contributor Author

@dbrgn: while it wasn't strictly necessary (would've merged just fine also without this) i've now rebased this on top of the latest main and also adjusted a comment which still had a link to the e-h beta documentation.
once this PR lands in a release of e-h-m (it was my hope that it'd land in the release you just did) i'll be able to point to your release again in my crate (since i need this)

thanks for your work on this crate!

CHANGELOG.md Outdated Show resolved Hide resolved
src/eh1/pwm.rs Outdated Show resolved Hide resolved
src/eh1/pwm.rs Outdated Show resolved Hide resolved
src/eh1/pwm.rs Outdated Show resolved Hide resolved
src/eh1/pwm.rs Outdated Show resolved Hide resolved
src/eh1/pwm.rs Outdated Show resolved Hide resolved
src/eh1/pwm.rs Outdated Show resolved Hide resolved
src/eh1/pwm.rs Outdated Show resolved Hide resolved
this is the 1.0 equivalent of the old `PwmPin` trait (the mock for this
has been added in dbrgn#52).

note that the test coverage is fully handled by the doc test which is
why there's no additional `mod test` in this file.

this fixes dbrgn#73
@rursprung rursprung requested a review from dbrgn November 5, 2023 22:50
@rursprung
Copy link
Contributor Author

thanks for all your feedback @dbrgn, i've incorporated it now

Copy link
Owner

@dbrgn dbrgn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates!

@dbrgn dbrgn merged commit 0c2bbf5 into dbrgn:main Nov 23, 2023
3 checks passed
@dbrgn dbrgn mentioned this pull request Nov 23, 2023
@dbrgn
Copy link
Owner

dbrgn commented Nov 23, 2023

Released in 0.10.0-rc.2.

@rursprung rursprung deleted the add-SetDutyCycle branch November 24, 2023 06:50
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

Successfully merging this pull request may close these issues.

add mock for e-h 1 SetDutyCycle (PwmPin successor) trait
2 participants