mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Improve MetaDataRef:{get,set}_float
precision (#13130)
This commit is contained in:
parent
5f2925c59c
commit
3992a13f24
2 changed files with 13 additions and 3 deletions
|
@ -63,6 +63,13 @@ local function test_metadata(meta)
|
|||
assert(meta:get_float("h") > 1)
|
||||
assert(meta:get_string("i") == "${f}")
|
||||
|
||||
meta:set_float("j", 1.23456789)
|
||||
assert(meta:get_float("j") == 1.23456789)
|
||||
meta:set_float("j", -1 / 0)
|
||||
assert(meta:get_float("j") == -1 / 0)
|
||||
meta:set_float("j", 0 / 0)
|
||||
assert(core.is_nan(meta:get_float("j")))
|
||||
|
||||
meta:from_table()
|
||||
assert(next(meta:to_table().fields) == nil)
|
||||
assert(#meta:get_keys() == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue