From 95a6b6b1c002aaa9a1ce25c82ea367287bb8958f Mon Sep 17 00:00:00 2001 From: anod221 Date: Fri, 31 Aug 2018 11:20:24 +0800 Subject: [PATCH] update test for slice --- test.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test.lua b/test.lua index 1735a06..d1d6388 100644 --- a/test.lua +++ b/test.lua @@ -304,6 +304,12 @@ local function test_slice() for i=1, #g do assert( g[i] == buf[i] ) end + local h = buf:slice( 1000, 2000 ) + assert( #h == 0 ) + local i = buf:slice( 6, 3 ) + assert( #h == 0 ) + local j = buf:slice( -1000, -900 ) + assert( #h == 0 ) end test_readonly()