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 tests to BOD and fix parsing #61

Merged
merged 3 commits into from
Oct 20, 2022
Merged

Conversation

clemarescx
Copy link

This PR adds 5 tests for parsing BOD, using the two examples from gpsd's BOD - Bearing - Waypoint to Waypoint. The checksums were not correct so they were recalculated.

The tests cover sentences with active route, and without (described as GOTO mode in the reference page):

  • active route format
    • both waypoints
    • missing destination waypoint field
    • missing origin waypoint field
  • GOTO mode
  • missing bearing field

The current implementation only worked for the active route format (i.e both waypoints are present), so I fixed the implementation to pass all tests.

@elpiel
Copy link
Member

elpiel commented Oct 20, 2022

Thank you for fixing this and adding more tests! 🥳

And congratulations on your first contribution.

@codecov
Copy link

codecov bot commented Oct 20, 2022

Codecov Report

Base: 76.27% // Head: 78.64% // Increases project coverage by +2.36% 🎉

Coverage data is based on head (acceca0) compared to base (500175e).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #61      +/-   ##
==========================================
+ Coverage   76.27%   78.64%   +2.36%     
==========================================
  Files          21       21              
  Lines         801      796       -5     
==========================================
+ Hits          611      626      +15     
+ Misses        190      170      -20     
Impacted Files Coverage Δ
src/sentences/bod.rs 86.66% <100.00%> (+86.66%) ⬆️
src/sentences/utils.rs 100.00% <0.00%> (+6.89%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@elpiel elpiel added the hacktoberfest-accpeted Hacktoberfest accepted PR label Oct 20, 2022
@elpiel elpiel merged commit d5f1209 into AeroRust:main Oct 20, 2022
@elpiel elpiel linked an issue Oct 20, 2022 that may be closed by this pull request
18 tasks
@elpiel elpiel removed a link to an issue Oct 20, 2022
18 tasks
@elpiel elpiel linked an issue Oct 20, 2022 that may be closed by this pull request
@clemarescx clemarescx deleted the bod_add_tests branch October 31, 2022 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accpeted Hacktoberfest accepted PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supporting additional sentences
2 participants