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 more tests for components parsing #602

Merged

Conversation

alexcrichton
Copy link
Member

This commit uses coverage to find holes in where we weren't testing
parser support for a feature in the component model. Additionally some
AST changes were made along the way:

  • The wasmprinter output for canonical abi options were tweaked:
    • string-related options are prefixed with string=
    • the into option no longer prints (instance ...), it only prints
      the instance index
  • The name of parameters in function types was changed to a &str from
    the id/name annotation combo.
  • A number of unused Peek implementations were removed.
  • Some dynamically dead code was replaced with unreachable! to
    emphasize it shouldn't be executed.
  • A subtraction-overflow issue was fixed in name resolution for outer
    aliases which try to reach too far.
  • Parsing ComponentTypeUse as a simple index like $foo was removed
    as it's expected to either be (type $idx) or an inline definition.

This commit uses coverage to find holes in where we weren't testing
parser support for a feature in the component model. Additionally some
AST changes were made along the way:

* The `wasmprinter` output for canonical abi options were tweaked:
  * string-related options are prefixed with `string=`
  * the `into` option no longer prints `(instance ...)`, it only prints
    the instance index
* The name of parameters in function types was changed to a `&str` from
  the id/name annotation combo.
* A number of unused `Peek` implementations were removed.
* Some dynamically dead code was replaced with `unreachable!` to
  emphasize it shouldn't be executed.
* A subtraction-overflow issue was fixed in name resolution for outer
  aliases which try to reach too far.
* Parsing `ComponentTypeUse` as a simple index like `$foo` was removed
  as it's expected to either be `(type $idx)` or an inline definition.
@alexcrichton alexcrichton merged commit e359e1e into bytecodealliance:main May 16, 2022
@alexcrichton alexcrichton deleted the more-component-testing branch May 16, 2022 23:33
code-terror pushed a commit to code-terror/wasm-tools that referenced this pull request Aug 24, 2022
This commit uses coverage to find holes in where we weren't testing
parser support for a feature in the component model. Additionally some
AST changes were made along the way:

* The `wasmprinter` output for canonical abi options were tweaked:
  * string-related options are prefixed with `string=`
  * the `into` option no longer prints `(instance ...)`, it only prints
    the instance index
* The name of parameters in function types was changed to a `&str` from
  the id/name annotation combo.
* A number of unused `Peek` implementations were removed.
* Some dynamically dead code was replaced with `unreachable!` to
  emphasize it shouldn't be executed.
* A subtraction-overflow issue was fixed in name resolution for outer
  aliases which try to reach too far.
* Parsing `ComponentTypeUse` as a simple index like `$foo` was removed
  as it's expected to either be `(type $idx)` or an inline definition.
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

2 participants