aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_flatten.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_flatten.vim')
-rw-r--r--src/nvim/testdir/test_flatten.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_flatten.vim b/src/nvim/testdir/test_flatten.vim
index 99086611e1..d8abc1ad68 100644
--- a/src/nvim/testdir/test_flatten.vim
+++ b/src/nvim/testdir/test_flatten.vim
@@ -79,3 +79,14 @@ func Test_flatten()
call assert_equal([1, 2, 1, 2], flatten(l:x, 2))
call assert_equal([2, l:x], l:y)
endfunc
+
+func Test_flattennew()
+ let l = [1, [2, [3, 4]], 5]
+ call assert_equal([1, 2, 3, 4, 5], flattennew(l))
+ call assert_equal([1, [2, [3, 4]], 5], l)
+
+ call assert_equal([1, 2, [3, 4], 5], flattennew(l, 1))
+ call assert_equal([1, [2, [3, 4]], 5], l)
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab