diff --git a/crates/moon/tests/test_cases/expect_test.in/lib/hello.mbt b/crates/moon/tests/test_cases/expect_test.in/lib/hello.mbt index 25ffa6e1..84f78b77 100644 --- a/crates/moon/tests/test_cases/expect_test.in/lib/hello.mbt +++ b/crates/moon/tests/test_cases/expect_test.in/lib/hello.mbt @@ -3,46 +3,46 @@ pub fn hello() -> String { } test "basic" { - let buf = Buffer::new() + let buf = @buffer.new() let n = 123 buf.write_string(n.to_string()) - buf.expect!() + inspect!(buf) } test "indent" { let _ = { - let buf = Buffer::new() + let buf = @buffer.new() let s = "haha" buf.write_string(s) - buf.expect!() + inspect!(buf) } () } test "auto_reset" { - let buf = Buffer::new() + let buf = @buffer.new() let s = "haha" buf.write_string(s) - buf.expect!() + inspect!(buf) let s = "123" buf.write_string(s) - buf.expect!(content="123") + inspect!(buf, content="123") } test "multiline-string" { - let buf = Buffer::new() + let buf = @buffer.new() let s = "1\n2\n3\n" buf.write_string(s) - buf.expect!() + inspect!(buf) } test "multiline-string-2" { - let buf = Buffer::new() + let buf = @buffer.new() let s = #|abc #|def buf.write_string(s) - buf.expect!( + inspect!(buf, content= #|bcd #|defg @@ -51,9 +51,9 @@ test "multiline-string-2" { } test "not-empty-expect" { - let buf = Buffer::new() + let buf = @buffer.new() buf.write_string("123") - buf.expect!(content="1") + inspect!(buf, content="1") } test { @@ -128,15 +128,15 @@ test { } test { - let buf = Buffer::new() + let buf = @buffer.new() buf.write_string("just\ntest") - buf.expect!() + inspect!(buf) } test "hello" { - let buf = Buffer::new() + let buf = @buffer.new() buf.write_string("just\ntest") - buf.expect!(content="") + inspect!(buf, content="") } fn actual() -> String { diff --git a/crates/moon/tests/test_cases/expect_test.in/lib/hello_wbtest.mbt b/crates/moon/tests/test_cases/expect_test.in/lib/hello_wbtest.mbt index 62e7ad67..b6425ee0 100644 --- a/crates/moon/tests/test_cases/expect_test.in/lib/hello_wbtest.mbt +++ b/crates/moon/tests/test_cases/expect_test.in/lib/hello_wbtest.mbt @@ -1,11 +1,11 @@ test "hello" { - let buf = Buffer::new() + let buf = @buffer.new() buf.write_string("just\ntest") - buf.expect!() + inspect!(buf) } test "not-buf" { - let notbuf = Buffer::new() + let notbuf = @buffer.new() notbuf.write_string("haha") - notbuf.expect!() + inspect!(notbuf) } diff --git a/crates/moon/tests/test_cases/mod.rs b/crates/moon/tests/test_cases/mod.rs index f2ef3e31..be07cc13 100644 --- a/crates/moon/tests/test_cases/mod.rs +++ b/crates/moon/tests/test_cases/mod.rs @@ -2246,7 +2246,7 @@ fn test_expect_test() -> anyhow::Result<()> { assert!(out.contains("Total tests: 30, passed: 30, failed: 0.")); let out = std::fs::read_to_string(tmp_dir_path.as_ref().join("lib").join("hello_wbtest.mbt")) .unwrap(); - assert!(out.contains(r#"notbuf.expect!(content="haha")"#)); + assert!(out.contains(r#"inspect!(notbuf, content="haha")"#)); Ok(()) } diff --git a/crates/moon/tests/test_cases/moon_run_with_cli_args.in/main/main_wasm.mbt b/crates/moon/tests/test_cases/moon_run_with_cli_args.in/main/main_wasm.mbt index c02d3958..aa100243 100644 --- a/crates/moon/tests/test_cases/moon_run_with_cli_args.in/main/main_wasm.mbt +++ b/crates/moon/tests/test_cases/moon_run_with_cli_args.in/main/main_wasm.mbt @@ -74,7 +74,7 @@ fn string_read_char(handle : StringReadHandle) -> Int = "__moonbit_fs_unstable" fn finish_read_string(handle : StringReadHandle) = "__moonbit_fs_unstable" "finish_read_string" pub fn string_from_extern(e : ExternString) -> String { - let buf = Buffer::new() + let buf = @buffer.new() let handle = begin_read_string(e) while true { let ch = string_read_char(handle) diff --git a/crates/moonrun/tests/test_cases/test_cli_args.in/main/main.mbt b/crates/moonrun/tests/test_cases/test_cli_args.in/main/main.mbt index b9363700..68494826 100644 --- a/crates/moonrun/tests/test_cases/test_cli_args.in/main/main.mbt +++ b/crates/moonrun/tests/test_cases/test_cli_args.in/main/main.mbt @@ -96,7 +96,7 @@ fn string_read_char(handle : StringReadHandle) -> Int = "__moonbit_fs_unstable" fn finish_read_string(handle : StringReadHandle) = "__moonbit_fs_unstable" "finish_read_string" fn string_from_extern(e : ExternString) -> String { - let buf = Buffer::new() + let buf = @buffer.new() let handle = begin_read_string(e) while true { let ch = string_read_char(handle)