Is there a more elegant way to print some text then debug::print(&utf8(b"some text printed out")); in Sui move?

44 Views Asked by At

I'm using the debug module from the std move package in a test function.

    use std::debug;

    /* std and sui modules debug tests */
    #[test]
    fun test_module(){
        debug::print(&utf8(b"some text printed out"));
    }

What other options do I have to print a text output to the console? What is the most elegant way to do this?

1

There are 1 best solutions below

0
Georges-Charles Brain On BEST ANSWER

Inside a test, you can do 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")
}

The test_utils module can be found here.