-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Added description of basic Move testing to the docs #575
Conversation
b297d51
to
2fdf6b0
Compare
2fdf6b0
to
d465441
Compare
get a compilation error: | ||
|
||
``` shell | ||
error[E06001]: unused value without 'drop' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent example of a problem to debug--folks new to linearity will definitely run into this all the time!
``` rust | ||
// create a dummy address and transfer the sword | ||
let dummy_address = @0xCAFE; | ||
Transfer::transfer(sword, dummy_address); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should make TestScenario::delete_for_testing
public. This would make things a bit more ergonomic for testers since they won't need to think of a dummy address.
Even if we make that change, we should keep your explanation from 479--495 about what the error means--I think that is a valuable point to make.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good idea. I would still keep this particular way of solving this problem here as I plan to introduce TestScenario
next as a Sui-specific library that helps writing Sui-specific tests (as opposed to the "pure" Move testing scenario). At the same time, I did not want to overwhelm the reader with introducing this library right away. Obviously I am happy to change this flow (or better yet, have someone else finesse it :-) ) if we decide on a better one.
Another bite-sized piece of Move developer docs covering basics of testing.
The next step is to introduce
TestScenario
module to have more of a "Sui feel" in testing code (and also to show how a package can be published using wallet CLI).