Files
mlua-rs-mlua/tests/debug.rs
T
Alex Orlenko cdbf04f50c Add pretty-print to the Debug formatting to Value to Table.
This would allow dumping any Lua variable in human readable form.
2023-04-11 20:36:41 +01:00

16 lines
285 B
Rust

use mlua::{Lua, Result};
#[test]
fn test_debug_format() -> Result<()> {
let lua = Lua::new();
// Globals
let globals = lua.globals();
let dump = format!("{globals:#?}");
assert!(dump.starts_with("{\n [\"_G\"] = <table"));
// TODO: Other cases
Ok(())
}