diff --git a/vlib/builtin/array_test.v b/vlib/builtin/array_test.v index 0d0f376ca4..18ab034807 100644 --- a/vlib/builtin/array_test.v +++ b/vlib/builtin/array_test.v @@ -240,3 +240,12 @@ fn test_struct_print() { assert b.str() == '{1 2}' assert a.b.str() == '[{1 2}, {1 2}]' } + +fn test_single_element() { + mut a := [1] + a << 2 + assert a.len == 2 + assert a[0] == 1 + assert a[1] == 2 + println(a) +}