-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testdata: special-case Resolve with single package
Do not write with additional braces for single-file, multi-package format. WebAssembly/component-model#340 bytecodealliance/wasm-tools#1577
- Loading branch information
Showing
22 changed files
with
5,124 additions
and
5,169 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,51 @@ | ||
package foo:bar; | ||
package foo:bar { | ||
interface a {} | ||
|
||
interface a {} | ||
interface b {} | ||
|
||
interface b {} | ||
|
||
world bar-a { | ||
import a; | ||
import b; | ||
} | ||
|
||
|
||
package foo:baz; | ||
|
||
interface a {} | ||
|
||
interface b {} | ||
|
||
world baz-a { | ||
import a; | ||
import b; | ||
world bar-a { | ||
import a; | ||
import b; | ||
} | ||
} | ||
|
||
package foo:baz { | ||
interface a {} | ||
|
||
package foo:root; | ||
interface b {} | ||
|
||
interface ai {} | ||
|
||
interface bi {} | ||
|
||
world a { | ||
import ai; | ||
import bi; | ||
} | ||
|
||
world b { | ||
import foo:bar/a; | ||
import foo:bar/b; | ||
world baz-a { | ||
import a; | ||
import b; | ||
} | ||
} | ||
|
||
world c { | ||
import foo:bar/a; | ||
import foo:bar/b; | ||
} | ||
|
||
world union-world { | ||
import ai; | ||
import bi; | ||
import foo:bar/a; | ||
import foo:bar/b; | ||
import foo:baz/a; | ||
import foo:baz/b; | ||
} | ||
package foo:root { | ||
interface ai {} | ||
|
||
interface bi {} | ||
|
||
world a { | ||
import ai; | ||
import bi; | ||
} | ||
|
||
world b { | ||
import foo:bar/a; | ||
import foo:bar/b; | ||
} | ||
|
||
world c { | ||
import foo:bar/a; | ||
import foo:bar/b; | ||
} | ||
|
||
world union-world { | ||
import ai; | ||
import bi; | ||
import foo:bar/a; | ||
import foo:bar/b; | ||
import foo:baz/a; | ||
import foo:baz/b; | ||
} | ||
} |
21 changes: 10 additions & 11 deletions
21
testdata/wit-parser/cross-package-resource.wit.json.golden.wit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
package foo:bar; | ||
|
||
interface foo { | ||
use some:dep/foo.{r}; | ||
type t = own<r>; | ||
package foo:bar { | ||
interface foo { | ||
use some:dep/foo.{r}; | ||
type t = own<r>; | ||
} | ||
} | ||
|
||
|
||
package some:dep; | ||
|
||
interface foo { | ||
resource r; | ||
} | ||
package some:dep { | ||
interface foo { | ||
resource r; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
package foo:dep1; | ||
|
||
interface types {} | ||
|
||
|
||
package foo:dep2; | ||
|
||
interface types {} | ||
|
||
|
||
package foo:foo; | ||
package foo:dep1 { | ||
interface types {} | ||
} | ||
|
||
world foo { | ||
import foo:dep1/types; | ||
import foo:dep2/types; | ||
package foo:dep2 { | ||
interface types {} | ||
} | ||
|
||
package foo:foo { | ||
world foo { | ||
import foo:dep1/types; | ||
import foo:dep2/types; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
package foo:empty; | ||
|
158 changes: 76 additions & 82 deletions
158
testdata/wit-parser/foreign-deps-union.wit.json.golden.wit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,92 @@ | ||
package foo:another-pkg; | ||
|
||
interface other-interface {} | ||
|
||
|
||
package foo:corp; | ||
|
||
interface saas {} | ||
|
||
|
||
package foo:different-pkg; | ||
|
||
interface i {} | ||
|
||
|
||
package foo:foreign-pkg; | ||
|
||
interface the-default { | ||
type some-type = u32; | ||
package foo:another-pkg { | ||
interface other-interface {} | ||
} | ||
|
||
|
||
package foo:root; | ||
|
||
interface foo { | ||
use foo:wasi/clocks.{timestamp}; | ||
use foo:wasi/filesystem.{stat}; | ||
package foo:corp { | ||
interface saas {} | ||
} | ||
|
||
interface bar { | ||
use foo:some-pkg/the-default.{from-default}; | ||
use foo:some-pkg/some-interface.{another-type}; | ||
use foo:some-pkg/another-interface.{yet-another-type}; | ||
package foo:different-pkg { | ||
interface i {} | ||
} | ||
|
||
interface use1 { | ||
use foo:foreign-pkg/the-default.{some-type}; | ||
package foo:foreign-pkg { | ||
interface the-default { | ||
type some-type = u32; | ||
} | ||
} | ||
|
||
interface use2 { | ||
use foo:foreign-pkg/the-default.{some-type}; | ||
package foo:root { | ||
interface foo { | ||
use foo:wasi/clocks.{timestamp}; | ||
use foo:wasi/filesystem.{stat}; | ||
} | ||
|
||
interface bar { | ||
use foo:some-pkg/the-default.{from-default}; | ||
use foo:some-pkg/some-interface.{another-type}; | ||
use foo:some-pkg/another-interface.{yet-another-type}; | ||
} | ||
|
||
interface use1 { | ||
use foo:foreign-pkg/the-default.{some-type}; | ||
} | ||
|
||
interface use2 { | ||
use foo:foreign-pkg/the-default.{some-type}; | ||
} | ||
|
||
world my-world { | ||
import foo:wasi/filesystem; | ||
import foo:wasi/clocks; | ||
export foo:corp/saas; | ||
} | ||
|
||
world my-world2 { | ||
import foo:wasi/filesystem; | ||
import foo:wasi/clocks; | ||
export foo; | ||
export foo:corp/saas; | ||
} | ||
|
||
world bars-world { | ||
import foo:some-pkg/the-default; | ||
import foo:another-pkg/other-interface; | ||
} | ||
|
||
world unionw-world { | ||
import foo:wasi/filesystem; | ||
import foo:wasi/clocks; | ||
export foo:corp/saas; | ||
export foo; | ||
} | ||
} | ||
|
||
world my-world { | ||
import foo:wasi/filesystem; | ||
import foo:wasi/clocks; | ||
export foo:corp/saas; | ||
} | ||
package foo:some-pkg { | ||
interface the-default { | ||
type from-default = string; | ||
} | ||
|
||
world my-world2 { | ||
import foo:wasi/filesystem; | ||
import foo:wasi/clocks; | ||
export foo; | ||
export foo:corp/saas; | ||
} | ||
interface some-interface { | ||
type another-type = u32; | ||
} | ||
|
||
world bars-world { | ||
import foo:some-pkg/the-default; | ||
import foo:another-pkg/other-interface; | ||
interface another-interface { | ||
type yet-another-type = u8; | ||
} | ||
} | ||
|
||
world unionw-world { | ||
import foo:wasi/filesystem; | ||
import foo:wasi/clocks; | ||
export foo:corp/saas; | ||
export foo; | ||
} | ||
package foo:wasi { | ||
interface clocks { | ||
type timestamp = u64; | ||
} | ||
|
||
interface filesystem { | ||
record stat { ino: u64 } | ||
} | ||
|
||
package foo:some-pkg; | ||
|
||
interface the-default { | ||
type from-default = string; | ||
} | ||
|
||
interface some-interface { | ||
type another-type = u32; | ||
} | ||
|
||
interface another-interface { | ||
type yet-another-type = u8; | ||
} | ||
|
||
|
||
package foo:wasi; | ||
|
||
interface clocks { | ||
type timestamp = u64; | ||
} | ||
|
||
interface filesystem { | ||
record stat { ino: u64 } | ||
} | ||
|
||
world wasi { | ||
import filesystem; | ||
import clocks; | ||
} | ||
world wasi { | ||
import filesystem; | ||
import clocks; | ||
} | ||
} |
Oops, something went wrong.