string_util
A utility library to pretty-print data, useful for tracing.
This library is no longer maintained since
Aiken v1.1.0
, it accepts multiple trace arguments: https://github.com/aiken-lang/aiken/pull/978
âšī¸ | Package info | aiken-extra/string_util v3.200.202409 | đ |
---|---|---|---|
đĸ | Depends on | aiken-lang/stdlib v2.0.0 | âī¸ |
đĸ | Tested with | aiken v1.1.0 | âī¸ |
Usage Example
use string_util/cbor.{print}
test should_unlock() {
// arrange:
let datum = datum.new(42)
let redeemer = redeemer.new(42)
// trace:
trace print("Datum", datum)
trace print("Redeemer", redeemer)
// assert:
unlock(datum, redeemer, 42)
}
will give something like,
ââ lock_unlock/tests ââââââââââââââââââââââââââââ
â PASS [mem: ####, cpu: ######] should_unlock
â âŗ Datum: "182a"
â âŗ Redeemer: "182a"
â PASS [mem: ####, cpu: ######] should_not_unlock
â âŗ Datum: "182a"
â âŗ Redeemer: "1818"
âââââââââââââââââââââââ 2 tests | 2 passed | 0 failed