-
Notifications
You must be signed in to change notification settings - Fork 2
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
[test] Add more custom-page-sizes tests #31
Conversation
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.
Thanks! One minor nitpick below and then we can merge this.
;; Maximum memory sizes. | ||
;; These modules are valid, but instantiating them would allocate | ||
;; a huge memory, so test with `assert_unlinkable` + a missing import. |
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.
Making a suggested rewording to this comment because it took me a little bit to understand the subtleties of this set up.
;; Maximum memory sizes. | |
;; These modules are valid, but instantiating them would allocate | |
;; a huge memory, so test with `assert_unlinkable` + a missing import. | |
;; Maximum memory sizes. | |
;; | |
;; These modules are valid, but instantiating them is unnecessary | |
;; and would only allocate very large memories and slow down running | |
;; the spec tests. Therefore, add a missing import so that it cannot | |
;; be instantiated and use `assert_unlinkable`. This approach | |
;; enforces that the module itself is still valid, but that its | |
;; instantiation fails early (hopefully before any memories are | |
;; actually allocated). |
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.
Also, since these modules are actually valid, it may make sense to remove these tests from this custom-page-sizes-invalid.wast
file and move them to the custom-page-sizes.wast
file (or alternatively to their own dedicated max-sized-memory.wast
file).
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.
sgtm -- done.
Co-authored-by: Nick Fitzgerald <[email protected]>
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.
Thanks!
This PR adds some tests that I found helpful in implementing the proposal in WABT.
wasm-tools already passes these (with the exception of the ones marked
;; Test data abbreviation syntax
-- I think thewast
crate hasn't added support for the abbreviation yet).