diff options
author | Alex Orlenko <zxteam@protonmail.com> | 2024-02-01 09:30:42 +0000 |
---|---|---|
committer | Alex Orlenko <zxteam@protonmail.com> | 2024-02-01 23:42:44 +0000 |
commit | f4d783cb414c9af1afbde9439b3d92c27fe952a6 (patch) | |
tree | 2e958ed1dd1560de0bf18e9a85fbfcdec7a12fb1 /tests/tests.rs | |
parent | f5982bc204684da6452f5316b1192c3b7a565a3d (diff) | |
download | mlua-f4d783cb414c9af1afbde9439b3d92c27fe952a6.zip |
Impl push_into_stack for StdResult
Diffstat (limited to 'tests/tests.rs')
-rw-r--r-- | tests/tests.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index 0310a82..4d072bb 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -505,44 +505,6 @@ fn test_panic() -> Result<()> { } #[test] -fn test_result_conversions() -> Result<()> { - let lua = Lua::new(); - let globals = lua.globals(); - - let ok = lua.create_function(|_, ()| Ok(Ok::<(), Error>(())))?; - let err = lua.create_function(|_, ()| Ok(Err::<(), _>("failure1".into_lua_err())))?; - let ok2 = lua.create_function(|_, ()| Ok(Ok::<_, Error>("!".to_owned())))?; - let err2 = lua.create_function(|_, ()| Ok(Err::<String, _>("failure2".into_lua_err())))?; - - globals.set("ok", ok)?; - globals.set("ok2", ok2)?; - globals.set("err", err)?; - globals.set("err2", err2)?; - - lua.load( - r#" - local r, e = ok() - assert(r == nil and e == nil) - - local r, e = err() - assert(r == nil) - assert(tostring(e):find("failure1") ~= nil) - - local r, e = ok2() - assert(r == "!") - assert(e == nil) - - local r, e = err2() - assert(r == nil) - assert(tostring(e):find("failure2") ~= nil) - "#, - ) - .exec()?; - - Ok(()) -} - -#[test] fn test_num_conversion() -> Result<()> { let lua = Lua::new(); |