diff options
author | Alex Orlenko <zxteam@protonmail.com> | 2022-01-29 12:36:09 +0000 |
---|---|---|
committer | Alex Orlenko <zxteam@protonmail.com> | 2022-01-29 12:36:09 +0000 |
commit | 6e4033abba37b7a9bbeb1c58daafb9649cc93c8c (patch) | |
tree | 2c63643108bf4c9a338db84c73982a7a6a660795 /tests/thread.rs | |
parent | c213a85ef0097e1622b1d7035449b33028c2a115 (diff) | |
download | mlua-6e4033abba37b7a9bbeb1c58daafb9649cc93c8c.zip |
Fix tests for Lua 5.4.4
Diffstat (limited to 'tests/thread.rs')
-rw-r--r-- | tests/thread.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/thread.rs b/tests/thread.rs index f2c12b6..ab687ad 100644 --- a/tests/thread.rs +++ b/tests/thread.rs @@ -130,7 +130,15 @@ fn test_thread_reset() -> Result<()> { assert_eq!(thread.status(), ThreadStatus::Error); assert_eq!(Arc::strong_count(&arc), 2); assert!(thread.reset(func.clone()).is_err()); - assert_eq!(thread.status(), ThreadStatus::Error); + // Reset behavior has changed in Lua v5.4.4 + // It's became possible to force reset thread by popping error object + assert!(matches!( + thread.status(), + ThreadStatus::Unresumable | ThreadStatus::Error + )); + // Would pass in 5.4.4 + // assert!(thread.reset(func.clone()).is_ok()); + // assert_eq!(thread.status(), ThreadStatus::Resumable); } Ok(()) |