Skip to content

Commit b1f99aa

Browse files
committed
Update tests
1 parent 4c54652 commit b1f99aa

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

mlua-sys/src/lua55/lua.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ pub const LUA_MULTRET: c_int = -1;
1313

1414
// Size of the Lua stack
1515
#[doc(hidden)]
16-
pub const LUAI_MAXSTACK: c_int = libc::INT_MAX;
16+
pub const LUAI_MAXSTACK: c_int = c_int::MAX;
1717

1818
// Size of a raw memory area associated with a Lua state with very fast access.
1919
pub const LUA_EXTRASPACE: usize = mem::size_of::<*const ()>();
2020

2121
//
2222
// Pseudo-indices
2323
//
24-
pub const LUA_REGISTRYINDEX: c_int = -(libc::INT_MAX / 2 + 1000);
24+
pub const LUA_REGISTRYINDEX: c_int = -(c_int::MAX / 2 + 1000);
2525

2626
pub const fn lua_upvalueindex(i: c_int) -> c_int {
2727
LUA_REGISTRYINDEX - i

tests/module/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ members = [
1313
]
1414

1515
[features]
16+
lua55 = ["mlua/lua55"]
1617
lua54 = ["mlua/lua54"]
1718
lua53 = ["mlua/lua53"]
1819
lua52 = ["mlua/lua52"]

tests/module/loader/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = ["Aleksandr Orlenko <zxteam@pm.me>"]
55
edition = "2021"
66

77
[features]
8+
lua55 = ["mlua/lua55"]
89
lua54 = ["mlua/lua54"]
910
lua53 = ["mlua/lua53"]
1011
lua52 = ["mlua/lua52"]

tests/serde.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn test_serialize() -> Result<(), Box<dyn StdError>> {
3636
_integer = 123,
3737
_number = 321.99,
3838
_string = "test string serialization",
39-
_table_arr = {nil, "value 1", nil, "value 2", {}},
39+
_table_arr = {null, "value 1", 2, "value 3", {}},
4040
_table_map = {["table"] = "map", ["null"] = null},
4141
_bytes = "\240\040\140\040",
4242
_userdata = ud,
@@ -53,7 +53,7 @@ fn test_serialize() -> Result<(), Box<dyn StdError>> {
5353
"_integer": 123,
5454
"_number": 321.99,
5555
"_string": "test string serialization",
56-
"_table_arr": [null, "value 1", null, "value 2", {}],
56+
"_table_arr": [null, "value 1", 2, "value 3", {}],
5757
"_table_map": {"table": "map", "null": null},
5858
"_bytes": [240, 40, 140, 40],
5959
"_userdata": [123, "test userdata"],
@@ -184,7 +184,7 @@ fn test_serialize_sorted() -> LuaResult<()> {
184184
_integer = 123,
185185
_number = 321.99,
186186
_string = "test string serialization",
187-
_table_arr = {nil, "value 1", nil, "value 2", {}},
187+
_table_arr = {null, "value 1", 2, "value 3", {}},
188188
_table_map = {["table"] = "map", ["null"] = null},
189189
_bytes = "\240\040\140\040",
190190
_null = null,
@@ -198,7 +198,7 @@ fn test_serialize_sorted() -> LuaResult<()> {
198198
let json = serde_json::to_string(&value.to_serializable().sort_keys(true)).unwrap();
199199
assert_eq!(
200200
json,
201-
r#"{"_bool":true,"_bytes":[240,40,140,40],"_empty_array":[],"_empty_map":{},"_integer":123,"_null":null,"_number":321.99,"_string":"test string serialization","_table_arr":[null,"value 1",null,"value 2",{}],"_table_map":{"null":null,"table":"map"}}"#
201+
r#"{"_bool":true,"_bytes":[240,40,140,40],"_empty_array":[],"_empty_map":{},"_integer":123,"_null":null,"_number":321.99,"_string":"test string serialization","_table_arr":[null,"value 1",2,"value 3",{}],"_table_map":{"null":null,"table":"map"}}"#
202202
);
203203

204204
Ok(())

0 commit comments

Comments
 (0)