MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / nested_components

Function nested_components

crates/wizer/tests/all/component.rs:374–409  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372
373#[tokio::test]
374async fn nested_components() -> Result<()> {
375 wizen_and_run_wat(
376 42,
377 r#"(component
378 (component $a)
379 (instance (instantiate $a))
380 (instance (export "hi") (instantiate $a))
381
382 (component $b
383 (type $t string)
384 (import "x" (type (eq $t)))
385 (component $a)
386 (instance (instantiate $a))
387 (instance (export "hi") (instantiate $a))
388 )
389 (type $x string)
390 (instance (instantiate $b
391 (with "x" (type $x))
392 ))
393 (instance (export "hi2") (instantiate $b
394 (with "x" (type $x))
395 ))
396
397 (core module $m
398 (func (export "init"))
399 (func (export "run") (param i32) (result i32) i32.const 42)
400 )
401 (core instance $i (instantiate $m))
402 (func (export "run") (param "arg" s32) (result s32) (canon lift (core func $i "run")))
403 (func (export "wizer-initialize") (canon lift (core func $i "init")))
404 )"#,
405 )
406 .await?;
407
408 Ok(())
409}
410
411#[tokio::test]
412async fn multiple_modules() -> Result<()> {

Callers

nothing calls this directly

Calls 2

wizen_and_run_watFunction · 0.85
OkFunction · 0.85

Tested by

no test coverage detected