| 3404 | |
| 3405 | #[test] |
| 3406 | fn wizer_no_imports_by_default() -> Result<()> { |
| 3407 | let result = wizen( |
| 3408 | &[], |
| 3409 | r#"(module |
| 3410 | (func (export "wizer-initialize")) |
| 3411 | )"#, |
| 3412 | )?; |
| 3413 | assert!(result.status.success()); |
| 3414 | |
| 3415 | let result = wizen( |
| 3416 | &[], |
| 3417 | r#"(module |
| 3418 | (import "foo" "bar" (func)) |
| 3419 | (func (export "wizer-initialize")) |
| 3420 | )"#, |
| 3421 | )?; |
| 3422 | assert!(!result.status.success()); |
| 3423 | |
| 3424 | let result = wizen( |
| 3425 | &[], |
| 3426 | r#"(module |
| 3427 | (import "wasi_snapshot_preview1" "fd_write" (func (param i32 i32 i32 i32) (result i32))) |
| 3428 | (func (export "wizer-initialize")) |
| 3429 | )"#, |
| 3430 | )?; |
| 3431 | assert!(!result.status.success()); |
| 3432 | |
| 3433 | let result = wizen( |
| 3434 | &["-Scli"], |
| 3435 | r#"(module |
| 3436 | (import "wasi_snapshot_preview1" "fd_write" (func (param i32 i32 i32 i32) (result i32))) |
| 3437 | (func (export "wizer-initialize")) |
| 3438 | )"#, |
| 3439 | )?; |
| 3440 | assert!(result.status.success()); |
| 3441 | |
| 3442 | Ok(()) |
| 3443 | } |
| 3444 | |
| 3445 | #[test] |
| 3446 | fn wizer_components() -> Result<()> { |