Skip to content

Commit b18bfa5

Browse files
committed
feat: implement map key conversions for primitives and enable referencing that way
1 parent 406235e commit b18bfa5

File tree

7 files changed

+571
-10
lines changed

7 files changed

+571
-10
lines changed

assets/tests/set/set_primitives_works.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ assert(resource.int == 42, "Expected 42, got " .. resource.int)
1414
assert(resource.float == 3.0, "Expected 3.14, got " .. resource.float)
1515
assert(resource.vec_usize[1] == 1, "Expected 1, got " .. resource.vec_usize[1])
1616
assert(resource.string_map:len() == 2, "Expected 2, got " .. resource.string_map:len())
17-
-- assert(resource.string_map["foo"] == "hello", "Expected 'hello', got " .. resource.string_map["foo"])
18-
-- assert(resource.string_map["zoo"] == "world", "Expected 'world', got " .. resource.string_map["zoo"])
17+
assert(resource.string_map["foo"] == "hello", "Expected 'hello', got " .. resource.string_map["foo"])
18+
assert(resource.string_map["zoo"] == "world", "Expected 'world', got " .. resource.string_map["zoo"])
1919

2020
resource.string = "Goodbye, World!"
2121
resource.bool = false
@@ -29,6 +29,5 @@ assert(resource.bool == false, "Expected false, got " .. tostring(resource.bool)
2929
assert(resource.int == 24, "Expected 24, got " .. resource.int)
3030
assert(resource.float == 1.0, "Expected 1.41, got " .. resource.float)
3131
assert(resource.string_map:len() == 2, "Expected 2, got " .. resource.string_map:len())
32-
-- assert(resource.string_map["foo"] == "goodbye", "Expected 'goodbye', got " .. resource.string_map["foo"])
33-
-- assert(resource.string_map["zoo"] == "world", "Expected 'world', got " .. resource.string_map["zoo"])
34-
32+
assert(resource.string_map["foo"] == "goodbye", "Expected 'goodbye', got " .. resource.string_map["foo"])
33+
assert(resource.string_map["zoo"] == "world", "Expected 'world', got " .. resource.string_map["zoo"])
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//! Conversions from untyped reflected values to concrete values
2+
3+
mod primitive;
4+
5+
pub use primitive::*;

0 commit comments

Comments
 (0)