forked from bytecodealliance/wasm-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinclude-reps.rs
More file actions
42 lines (32 loc) · 915 Bytes
/
Copy pathinclude-reps.rs
File metadata and controls
42 lines (32 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use pretty_assertions::assert_eq;
use wit_encoder::{Include, Interface, Package, PackageName, World};
const PACKAGE: &str = indoc::indoc! {"
package foo:foo;
interface a {}
interface b {}
world bar {
import a;
export b;
}
world foo {
include bar;
include bar;
include bar;
}
"};
#[test]
fn concrete_types() {
let mut package = Package::new(PackageName::new("foo", "foo", None));
package.interface(Interface::new("a"));
package.interface(Interface::new("b"));
let mut world = World::new("bar");
world.named_interface_import("a");
world.named_interface_export("b");
package.world(world);
let mut world = World::new("foo");
world.include(Include::new("bar"));
world.include(Include::new("bar"));
world.include(Include::new("bar"));
package.world(world);
assert_eq!(package.to_string(), PACKAGE);
}