     # Null values (of different types) in the array.
     arr = "*4\r\n$3\r\nfoo\r\n$-1\r\n$3\r\nbar\r\n*-1\r\n"
     assert parse(arr) == {:ok, ["foo", nil, "bar", nil], ""}
+  end
+
+  test "parse/1 with arrays whose length is incomplete" do
+    assert parse("*1") == {:error, :incomplete}
+  end
+
+  test "parse/1 with arrays that contain incomplete elements" do
+    assert parse("*1\r\n+OK") == {:error, :incomplete}
+  end
+
+  test "parse/1 with arrays with not enough elements" do
+    assert parse("*2\r\n+OK\r\n") == {:error, :incomplete}
   end
 
   test "parse/1 when the binary value has no type specifier" do

    # says it has 4 bytes, only has 3
    assert parse("$4\r\nops\r\n") == {:error, :incomplete}
  end
end

    assert parse("$2\r\n" <> <<1, 2>> <> "\r\n") == {:ok, <<1, 2>>, ""}
  end

  test "parse/1 with a bulk string whose length is malformed" do
    assert parse("$2") == {:error, :incomplete}
  end

  test "parse/1 with an empty array" do
    assert parse("*0\r\n") == {:ok, [], ""}
  end
