Skip to content

Commit

Permalink
testdata: special-case Resolve with single package
Browse files Browse the repository at this point in the history
Do not write with additional braces for single-file, multi-package format.

WebAssembly/component-model#340
bytecodealliance/wasm-tools#1577
  • Loading branch information
ydnar committed Jun 11, 2024
1 parent e4aea1e commit 1166bb7
Show file tree
Hide file tree
Showing 22 changed files with 5,124 additions and 5,169 deletions.
4,093 changes: 2,044 additions & 2,049 deletions testdata/wasi/cli.wit.json.golden.wit

Large diffs are not rendered by default.

5,356 changes: 2,675 additions & 2,681 deletions testdata/wasi/http.wit.json.golden.wit

Large diffs are not rendered by default.

88 changes: 43 additions & 45 deletions testdata/wit-parser/complex-include.wit.json.golden.wit
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 testdata/wit-parser/cross-package-resource.wit.json.golden.wit
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;
}
}
26 changes: 12 additions & 14 deletions testdata/wit-parser/diamond1.wit.json.golden.wit
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;
}
}
1 change: 1 addition & 0 deletions testdata/wit-parser/empty.wit.json.golden.wit
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package foo:empty;

158 changes: 76 additions & 82 deletions testdata/wit-parser/foreign-deps-union.wit.json.golden.wit
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;
}
}
Loading

0 comments on commit 1166bb7

Please sign in to comment.