From 295d5a85fe0a12b56a5754a498c63cf40898ad9c Mon Sep 17 00:00:00 2001 From: Frank Hunleth Date: Thu, 26 Sep 2024 15:30:41 -0400 Subject: [PATCH] Fix slice unit test This fixes the unit test so that it matches the result of `Enum.slice` on a regular list. ```elixir iex> Enum.slice([1, 2, 3, 4, 5], -6, 5) [1, 2, 3, 4, 5] ``` --- test/circular_buffer_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/circular_buffer_test.exs b/test/circular_buffer_test.exs index 6d325b4..19213a1 100644 --- a/test/circular_buffer_test.exs +++ b/test/circular_buffer_test.exs @@ -131,7 +131,7 @@ defmodule CircularBufferTest do assert Enum.slice(cb, 6, 5) == [] assert Enum.slice(cb, 6, 0) == [] assert Enum.slice(cb, -6, 0) == [] - assert Enum.slice(cb, -6, 5) == [] + assert Enum.slice(cb, -6, 5) == [1, 2, 3, 4, 5] assert Enum.slice(cb, -2, 5) == [4, 5] assert Enum.slice(cb, -3, 1) == [3]