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

Fix "Testing with Rust / Writing Tests" example #5539

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

smoelius
Copy link
Contributor

@smoelius smoelius commented Feb 2, 2024

Description

The harnes.rs code that currently appears in the book seems to be out of date (it doesn't compile).

The proposed code was copied from the sway-test-rs template.

(The Sway tutorial is very good, BTW.)

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@smoelius
Copy link
Contributor Author

smoelius commented Feb 6, 2024

I'm not sure if the checklist items apply. I think this PR is good to go.

)
.unwrap(),
),
LoadConfiguration::default(),
Copy link
Contributor

@IGI-111 IGI-111 Feb 8, 2024

Choose a reason for hiding this comment

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

This seems to be missing an equivalent with_storage_configuration call.
Without that it won't have the same behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without that it won't have the same behavior.

The code currently in the book doesn't compile. So I'm not quite sure what you mean.

Could I impose on you to push to my branch?

@sarahschwartz
Copy link
Member

A more permanent solution for this would be to import the code snippet from a tested example file. You can see how that is done here: https://github.com/FuelLabs/sway/blob/master/docs/book/src/basics/converting_types.md

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.

None yet

3 participants