diff options
Diffstat (limited to 'tests/modules/bytes/test.lua')
| -rw-r--r-- | tests/modules/bytes/test.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/modules/bytes/test.lua b/tests/modules/bytes/test.lua index aa29e3493..8d4504f2c 100644 --- a/tests/modules/bytes/test.lua +++ b/tests/modules/bytes/test.lua @@ -12,16 +12,19 @@ function test_ctor(t) t:are_equal(bytes(10):size(), 10) t:are_equal(bytes(bytes("123"), bytes("456"), bytes("789")):str(), "123456789") t:are_equal(bytes({bytes("123"), bytes("456"), bytes("789")}):str(), "123456789") + debug.collectgarbage() end function test_clone(t) t:are_equal(bytes(10):clone():size(), 10) t:are_equal(bytes("123456789"):clone():str(), "123456789") + debug.collectgarbage() end function test_slice(t) t:are_equal(bytes(10):slice(1, 2):size(), 2) t:are_equal(bytes("123456789"):slice(1, 4):str(), "1234") + debug.collectgarbage() end function test_index(t) @@ -34,9 +37,11 @@ function test_index(t) b[1] = string.byte('2') t:are_equal(b:str(), "223456789") t:will_raise(function() b[100] = string.byte('2') end) + debug.collectgarbage() end function test_concat(t) t:are_equal((bytes("123") .. bytes("456")):str(), "123456") t:are_equal(bytes(bytes("123"), bytes("456")):str(), "123456") + debug.collectgarbage() end |
