-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pretty-print to the Debug formatting to Value to Table.
This would allow dumping any Lua variable in human readable form.
- Loading branch information
Showing
3 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
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(()) | ||
} |