Skip to content

Initialize a test suite for wit-encoder#1626

Merged
alexcrichton merged 13 commits intobytecodealliance:mainfrom
yoshuawuyts:add-more-tests
Jun 20, 2024
Merged

Initialize a test suite for wit-encoder#1626
alexcrichton merged 13 commits intobytecodealliance:mainfrom
yoshuawuyts:add-more-tests

Conversation

@yoshuawuyts
Copy link
Copy Markdown
Member

Follow-up to #1549 and #1580, this begins adding a test suite for wit-encoder. Specifically: this takes the tests from wit-parser, and then tries to encode those in individual tests. It fixes a number of bugs, as well as adds support for include statements. It also changes the default indentation for WIT documents to 2, which matches the style that's been used in the WIT spec and WASI documents.

Not all .wit files have their own tests yet. But I ran out of time before I could finish up all the tests, but I figured even a partial test suite would already be a useful contribution. Thanks!

@yoshuawuyts
Copy link
Copy Markdown
Member Author

yoshuawuyts commented Jun 20, 2024

lmao, what in the Windows line-endings:

---- concrete_types stdout ----
thread 'concrete_types' panicked at crates\wit-encoder\tests\empty.rs:9:5:
assertion failed: `(left == right)`

Diff < left / right > :
 package foo:empty;

Copy link
Copy Markdown
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Thanks! I think if the files are included in the source files rather than as separate files that may also fix the line endings issue. Also for landing mind leaving out the WIT files that aren't yet tested?

Comment thread crates/wit-encoder/tests/functions.rs Outdated
@alexcrichton alexcrichton added this pull request to the merge queue Jun 20, 2024
Merged via the queue into bytecodealliance:main with commit 3e38098 Jun 20, 2024
@yoshuawuyts yoshuawuyts deleted the add-more-tests branch June 20, 2024 17:29
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.

2 participants