Skip to content

Commit 9518eaf

Browse files
authored
Migrate resource_into_inner test to wit-bindgen test (#1256)
Pretty straightforward translation
1 parent c581498 commit 9518eaf

File tree

7 files changed

+17
-35
lines changed

7 files changed

+17
-35
lines changed

crates/test-rust-wasm/src/bin/resource_into_inner.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include!(env!("BINDINGS"));
2+
3+
fn main() {
4+
crate::test::resource_into_inner::to_test::test();
5+
}

tests/runtime/resource_into_inner/wasm.cs renamed to tests/runtime-new/rust/resource_into_inner/test.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System.Diagnostics;
22

3-
namespace ResourceIntoInnerWorld.wit.exports.test.resourceIntoInner
3+
namespace TestWorld.wit.exports.test.resourceIntoInner
44
{
5-
public class TestImpl : ITest {
6-
public class Thing : ITest.Thing, ITest.IThing {
5+
public class ToTestImpl : IToTest {
6+
public class Thing : IToTest.Thing, IToTest.IThing {
77
public string val;
88

99
public Thing(string v) {

tests/runtime/resource_into_inner/wasm.rs renamed to tests/runtime-new/rust/resource_into_inner/test.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
wit_bindgen::generate!({
2-
path: "../../tests/runtime/resource_into_inner",
3-
});
1+
include!(env!("BINDINGS"));
42

5-
use exports::test::resource_into_inner::test::{Guest, GuestThing, Thing};
3+
use exports::test::resource_into_inner::to_test::{Guest, GuestThing, Thing};
64

75
pub struct Test;
86

Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
package test:resource-into-inner;
22

3-
interface test {
3+
interface to-test {
44
resource thing {
55
constructor(text: string);
66
}
77

88
test: func();
99
}
1010

11-
world resource-into-inner {
12-
export test;
11+
world test {
12+
export to-test;
13+
}
14+
15+
world runner {
16+
import to-test;
1317
}

tests/runtime/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ mod options;
1818
mod resource_alias;
1919
mod resource_floats;
2020
mod resource_import_and_export;
21-
mod resource_into_inner;
2221
mod resource_with_lists;
2322
mod resources;
2423
mod results;

tests/runtime/resource_into_inner.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)