我在测试函数中使用 std move 包中的调试模块。
use std::debug;
/* std and sui modules debug tests */
#[test]
fun test_module(){
debug::print(&utf8(b"some text printed out"));
}
我还需要哪些其他选项才能将文本输出打印到控制台? 最优雅的方法是什么?
在测试中,您可以执行以下操作
test_utils::print(b"some text printed out")
use sui::test_utils::{Self};
/* std and sui modules debug tests */
#[test]
fun test_module(){
test_utils::print(b"some text printed out")
}
test_utils 模块可以在这里找到。