diff --git a/vlib/builtin/array_test.v b/vlib/builtin/array_test.v index 11104cbbaa..9863f5cef0 100644 --- a/vlib/builtin/array_test.v +++ b/vlib/builtin/array_test.v @@ -117,8 +117,11 @@ fn test_repeat() { fn test_right() { a := [1, 2, 3, 4] b := a.right(1) + c := a[1..a.len] assert b[0] == 2 assert b[1] == 3 + assert c[0] == 2 + assert c[1] == 3 } fn test_right_with_n_bigger_than_array_size() { @@ -138,8 +141,11 @@ fn test_right_with_n_bigger_than_array_size() { fn test_left() { a := [1, 2, 3] b := a.left(2) + c := a[0..2] assert b[0] == 1 assert b[1] == 2 + assert c[0] == 1 + assert c[1] == 2 } fn test_slice() { diff --git a/vlib/builtin/string_test.v b/vlib/builtin/string_test.v index 7619027940..e4c9b362d2 100644 --- a/vlib/builtin/string_test.v +++ b/vlib/builtin/string_test.v @@ -208,6 +208,8 @@ fn test_runes() { assert u.len == 6 assert s2.substr(1, 4).len == 3 assert s2.substr(1, 4) == 'riv' + assert s2[1..4].len == 3 + assert s2[1..4] == 'riv' assert u.substr(1, 4).len == 6 assert u.substr(1, 4) == 'рив' assert s2.substr(1, 2) == 'r'