From cb099dedd27ecfb5d52d5991b44de22eb86ff336 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 7 Apr 2022 21:01:13 +0800 Subject: add move to bytes --- tests/modules/bytes/test.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/modules/bytes/test.lua') diff --git a/tests/modules/bytes/test.lua b/tests/modules/bytes/test.lua index 5e1d29a61..ef450ebce 100644 --- a/tests/modules/bytes/test.lua +++ b/tests/modules/bytes/test.lua @@ -39,9 +39,16 @@ end function test_copy(t) t:are_equal(bytes(9):copy("123456789"):str(), "123456789") + t:are_equal(bytes(5):copy("123456789", 5, 9):str(), "56789") end function test_copy2(t) t:are_equal(bytes(18):copy("123456789"):copy2(10, "123456789"):str(), "123456789123456789") + t:are_equal(bytes(14):copy("123456789"):copy2(10, "123456789", 5, 9):str(), "12345678956789") +end + +function test_move(t) + t:are_equal(bytes(9):copy("123456789"):move(5, 9):str(), "567896789") + t:are_equal(bytes(9):copy("123456789"):move2(2, 5, 9):str(), "156789789") end -- cgit v1.3.1