Skip to content

Commit

Permalink
wit, testdata: use package-relative names for import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ydnar committed Oct 2, 2023
1 parent 106a9d4 commit aaaac38
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 145 deletions.
4 changes: 2 additions & 2 deletions testdata/disambiguate-diamond.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ interface shared2 {

world foo {
import bar: interface {
use foo:diamond/shared2.{the-type};
use shared2.{the-type};
};
import foo: interface {
use foo:diamond/shared1.{the-type};
use shared1.{the-type};
};
import shared1;
import shared2;
Expand Down
22 changes: 11 additions & 11 deletions testdata/multi-file.wit.json.golden.wit
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
package foo:multi-file;

interface bar {
use foo:multi-file/irrelevant-name.{a-name};
use foo:multi-file/foo.{x};
use foo:multi-file/foo.{x as x2};
use foo:multi-file/foo.{x as x3};
use foo:multi-file/depend-on-me.{x as x4};
use foo:multi-file/something-else.{y};
use foo:multi-file/something-else.{y as y2};
use irrelevant-name.{a-name};
use foo.{x};
use foo.{x as x2};
use foo.{x as x3};
use depend-on-me.{x as x4};
use something-else.{y};
use something-else.{y as y2};
}

interface cycle1 {
type t = u32;
}

interface cycle2 {
use foo:multi-file/cycle1.{t};
use cycle1.{t};
}

interface cycle3 {
use foo:multi-file/cycle2.{t};
use cycle2.{t};
}

interface depend-on-me {
type x = u32;
}

interface depends-on-later-item {
use foo:multi-file/depend-on-me.{x};
use depend-on-me.{x};
}

interface foo {
Expand All @@ -52,5 +52,5 @@ world more-depends-on-later-things {
world the-world {
import foo: func() -> x;
import depend-on-me;
use foo:multi-file/depend-on-me.{x};
use depend-on-me.{x};
}
180 changes: 90 additions & 90 deletions testdata/stress-export-elaborate.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -14,120 +14,120 @@ interface i1 {
}

interface i10 {
use foo:bar/i9.{t1};
use foo:bar/i9.{t10};
use foo:bar/i9.{t2};
use foo:bar/i9.{t3};
use foo:bar/i9.{t4};
use foo:bar/i9.{t5};
use foo:bar/i9.{t6};
use foo:bar/i9.{t7};
use foo:bar/i9.{t8};
use foo:bar/i9.{t9};
use i9.{t1};
use i9.{t10};
use i9.{t2};
use i9.{t3};
use i9.{t4};
use i9.{t5};
use i9.{t6};
use i9.{t7};
use i9.{t8};
use i9.{t9};
}

interface i2 {
use foo:bar/i1.{t1};
use foo:bar/i1.{t10};
use foo:bar/i1.{t2};
use foo:bar/i1.{t3};
use foo:bar/i1.{t4};
use foo:bar/i1.{t5};
use foo:bar/i1.{t6};
use foo:bar/i1.{t7};
use foo:bar/i1.{t8};
use foo:bar/i1.{t9};
use i1.{t1};
use i1.{t10};
use i1.{t2};
use i1.{t3};
use i1.{t4};
use i1.{t5};
use i1.{t6};
use i1.{t7};
use i1.{t8};
use i1.{t9};
}

interface i3 {
use foo:bar/i2.{t1};
use foo:bar/i2.{t10};
use foo:bar/i2.{t2};
use foo:bar/i2.{t3};
use foo:bar/i2.{t4};
use foo:bar/i2.{t5};
use foo:bar/i2.{t6};
use foo:bar/i2.{t7};
use foo:bar/i2.{t8};
use foo:bar/i2.{t9};
use i2.{t1};
use i2.{t10};
use i2.{t2};
use i2.{t3};
use i2.{t4};
use i2.{t5};
use i2.{t6};
use i2.{t7};
use i2.{t8};
use i2.{t9};
}

interface i4 {
use foo:bar/i3.{t1};
use foo:bar/i3.{t10};
use foo:bar/i3.{t2};
use foo:bar/i3.{t3};
use foo:bar/i3.{t4};
use foo:bar/i3.{t5};
use foo:bar/i3.{t6};
use foo:bar/i3.{t7};
use foo:bar/i3.{t8};
use foo:bar/i3.{t9};
use i3.{t1};
use i3.{t10};
use i3.{t2};
use i3.{t3};
use i3.{t4};
use i3.{t5};
use i3.{t6};
use i3.{t7};
use i3.{t8};
use i3.{t9};
}

interface i5 {
use foo:bar/i4.{t1};
use foo:bar/i4.{t10};
use foo:bar/i4.{t2};
use foo:bar/i4.{t3};
use foo:bar/i4.{t4};
use foo:bar/i4.{t5};
use foo:bar/i4.{t6};
use foo:bar/i4.{t7};
use foo:bar/i4.{t8};
use foo:bar/i4.{t9};
use i4.{t1};
use i4.{t10};
use i4.{t2};
use i4.{t3};
use i4.{t4};
use i4.{t5};
use i4.{t6};
use i4.{t7};
use i4.{t8};
use i4.{t9};
}

interface i6 {
use foo:bar/i5.{t1};
use foo:bar/i5.{t10};
use foo:bar/i5.{t2};
use foo:bar/i5.{t3};
use foo:bar/i5.{t4};
use foo:bar/i5.{t5};
use foo:bar/i5.{t6};
use foo:bar/i5.{t7};
use foo:bar/i5.{t8};
use foo:bar/i5.{t9};
use i5.{t1};
use i5.{t10};
use i5.{t2};
use i5.{t3};
use i5.{t4};
use i5.{t5};
use i5.{t6};
use i5.{t7};
use i5.{t8};
use i5.{t9};
}

interface i7 {
use foo:bar/i6.{t1};
use foo:bar/i6.{t10};
use foo:bar/i6.{t2};
use foo:bar/i6.{t3};
use foo:bar/i6.{t4};
use foo:bar/i6.{t5};
use foo:bar/i6.{t6};
use foo:bar/i6.{t7};
use foo:bar/i6.{t8};
use foo:bar/i6.{t9};
use i6.{t1};
use i6.{t10};
use i6.{t2};
use i6.{t3};
use i6.{t4};
use i6.{t5};
use i6.{t6};
use i6.{t7};
use i6.{t8};
use i6.{t9};
}

interface i8 {
use foo:bar/i7.{t1};
use foo:bar/i7.{t10};
use foo:bar/i7.{t2};
use foo:bar/i7.{t3};
use foo:bar/i7.{t4};
use foo:bar/i7.{t5};
use foo:bar/i7.{t6};
use foo:bar/i7.{t7};
use foo:bar/i7.{t8};
use foo:bar/i7.{t9};
use i7.{t1};
use i7.{t10};
use i7.{t2};
use i7.{t3};
use i7.{t4};
use i7.{t5};
use i7.{t6};
use i7.{t7};
use i7.{t8};
use i7.{t9};
}

interface i9 {
use foo:bar/i8.{t1};
use foo:bar/i8.{t10};
use foo:bar/i8.{t2};
use foo:bar/i8.{t3};
use foo:bar/i8.{t4};
use foo:bar/i8.{t5};
use foo:bar/i8.{t6};
use foo:bar/i8.{t7};
use foo:bar/i8.{t8};
use foo:bar/i8.{t9};
use i8.{t1};
use i8.{t10};
use i8.{t2};
use i8.{t3};
use i8.{t4};
use i8.{t5};
use i8.{t6};
use i8.{t7};
use i8.{t8};
use i8.{t9};
}

world foo {
Expand Down
2 changes: 1 addition & 1 deletion testdata/use-chain.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ interface foo {
}

interface name {
use foo:name/foo.{foo};
use foo.{foo};
}
12 changes: 6 additions & 6 deletions testdata/use.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ interface bar {
}

interface baz {
use foo:foo/bar.{the-type as test};
use foo:foo/foo.{the-type};
use bar.{the-type as test};
use foo.{the-type};
}

interface empty {}

interface foo {
use foo:foo/bar.{the-type};
use bar.{the-type};
}

interface trailing-comma {
record the-foo { a: the-type };
use foo:foo/foo.{the-type};
use foo.{the-type};
}

interface use-from-empty {}

interface use-multiple {
use foo:foo/baz.{test};
use foo:foo/baz.{the-type};
use baz.{test};
use baz.{the-type};
some-function: func(x: the-type) -> test;
}
2 changes: 1 addition & 1 deletion testdata/wasi/clocks.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface monotonic-clock {
}

interface timezone {
use wasi:clocks/wall-clock.{datetime};
use wall-clock.{datetime};
record timezone-display {
utc-offset: s32,
name: string,
Expand Down
4 changes: 2 additions & 2 deletions testdata/world-diamond.wit.json.golden.wit
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package foo:foo;

interface i1 {
use foo:foo/shared-items.{foo};
use shared-items.{foo};
a: func() -> foo;
}

interface i2 {
use foo:foo/shared-items.{foo};
use shared-items.{foo};
a: func() -> foo;
}

Expand Down
2 changes: 1 addition & 1 deletion testdata/world-iface-no-collide.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ interface foo {
world bar {
import foo: func();
import foo;
use foo:foo/foo.{t};
use foo.{t};
}
2 changes: 1 addition & 1 deletion testdata/world-implicit-import1.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface foo {

world the-world {
import bar: interface {
use foo:foo/foo.{a};
use foo.{a};
};
import foo: interface {};
import foo;
Expand Down
2 changes: 1 addition & 1 deletion testdata/world-implicit-import2.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ interface foo {

world w {
import foo: func() -> g;
use foo:foo/foo.{g};
use foo.{g};
import foo;
}
2 changes: 1 addition & 1 deletion testdata/world-implicit-import3.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface foo {
}

world w {
use foo:foo/foo.{g};
use foo.{g};
import foo;
export foo: func() -> g;
}
2 changes: 1 addition & 1 deletion testdata/world-same-fields4.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ world foo {
import shared-items;
import shared-items: interface {};
export a-name: interface {
use foo:foo/shared-items.{a};
use shared-items.{a};
};
}
4 changes: 2 additions & 2 deletions testdata/world-top-level-resources.wit.json.golden.wit
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package foo:foo;

interface handler {
use foo:foo/types.{request};
use foo:foo/types.{response};
use types.{request};
use types.{response};
handle: func(some: borrow<request>) -> borrow<response>;
handle-owned: func(some: own<request>) -> own<response>;
}
Expand Down
2 changes: 1 addition & 1 deletion testdata/worlds-with-types.wit.json.golden.wit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface disambiguate {

world bar {
import disambiguate;
use foo:foo/disambiguate.{t};
use disambiguate.{t};
export foo: func() -> t;
}

Expand Down
Loading

0 comments on commit aaaac38

Please sign in to comment.