Skip to content

Commit

Permalink
testdata: import new fixtures from wit-parser crate
Browse files Browse the repository at this point in the history
  • Loading branch information
ydnar committed Dec 24, 2024
1 parent e81a5d8 commit 0485f1a
Show file tree
Hide file tree
Showing 18 changed files with 1,296 additions and 0 deletions.
70 changes: 70 additions & 0 deletions testdata/wit-parser/feature-types.wit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"worlds": [],
"interfaces": [
{
"name": "foo",
"types": {
"bar": 0
},
"functions": {
"my-stable": {
"name": "my-stable",
"kind": "freestanding",
"params": [
{
"name": "p",
"type": 0
}
],
"results": [
{
"type": 1
}
]
}
},
"package": 0
}
],
"types": [
{
"name": "bar",
"kind": {
"variant": {
"cases": [
{
"name": "x",
"type": null
},
{
"name": "y",
"type": null
}
]
}
},
"owner": {
"interface": 0
}
},
{
"name": null,
"kind": {
"result": {
"ok": null,
"err": 0
}
},
"owner": null
}
],
"packages": [
{
"name": "a:b",
"interfaces": {
"foo": 0
},
"worlds": {}
}
]
}
6 changes: 6 additions & 0 deletions testdata/wit-parser/feature-types.wit.json.golden.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package a:b;

interface foo {
variant bar { x, y }
my-stable: func(p: bar) -> result<_, bar>;
}
161 changes: 161 additions & 0 deletions testdata/wit-parser/multi-package-deps.wit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"worlds": [],
"interfaces": [
{
"name": "i2",
"types": {
"t": 0
},
"functions": {},
"package": 0
},
{
"name": "i1",
"types": {
"t": 1,
"o": 2
},
"functions": {},
"package": 1
},
{
"name": "nesty",
"types": {
"o": 3,
"l": 4
},
"functions": {},
"package": 2
},
{
"name": "i0",
"types": {
"o": 5,
"l": 6,
"r": 7,
"r1": 8
},
"functions": {},
"package": 3
}
],
"types": [
{
"name": "t",
"kind": {
"type": "string"
},
"owner": {
"interface": 0
}
},
{
"name": "t",
"kind": {
"type": 0
},
"owner": {
"interface": 1
}
},
{
"name": "o",
"kind": {
"option": 1
},
"owner": {
"interface": 1
}
},
{
"name": "o",
"kind": {
"type": 2
},
"owner": {
"interface": 2
}
},
{
"name": "l",
"kind": {
"list": 3
},
"owner": {
"interface": 2
}
},
{
"name": "o",
"kind": {
"type": 2
},
"owner": {
"interface": 3
}
},
{
"name": "l",
"kind": {
"type": 4
},
"owner": {
"interface": 3
}
},
{
"name": "r",
"kind": {
"result": {
"ok": 5,
"err": null
}
},
"owner": {
"interface": 3
}
},
{
"name": "r1",
"kind": {
"result": {
"ok": 6,
"err": null
}
},
"owner": {
"interface": 3
}
}
],
"packages": [
{
"name": "foo:dep2",
"interfaces": {
"i2": 0
},
"worlds": {}
},
{
"name": "foo:dep1",
"interfaces": {
"i1": 1
},
"worlds": {}
},
{
"name": "foo:nest",
"interfaces": {
"nesty": 2
},
"worlds": {}
},
{
"name": "foo:root",
"interfaces": {
"i0": 3
},
"worlds": {}
}
]
}
28 changes: 28 additions & 0 deletions testdata/wit-parser/multi-package-deps.wit.json.golden.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package foo:root;

interface i0 {
use foo:dep1/i1.{o};
use foo:nest/nesty.{l};
type r = result<o>;
type r1 = result<l>;
}

package foo:nest {
interface nesty {
use foo:dep1/i1.{o};
type l = list<o>;
}
}

package foo:dep1 {
interface i1 {
use foo:dep2/i2.{t};
type o = option<t>;
}
}

package foo:dep2 {
interface i2 {
type t = string;
}
}
Loading

0 comments on commit 0485f1a

Please sign in to comment.