summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-01-20 18:43:45 +0800
committerGitHub <noreply@github.com>2023-01-20 11:43:45 +0100
commitb82b5d44afbd860075f806f71a62d595f2376d6e (patch)
treebe6cc41260d5f09e34eb7ab698904ae45da8ae53 /tests
parent4c74b9b54ceac22865a0104970edb4d9c5376f96 (diff)
downloadNim-b82b5d44afbd860075f806f71a62d595f2376d6e.tar.gz
fixes #21278; `deques.shrink` off by one bug (#21284)
fixes #21278; deques.shrink off ny one bug
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tdeques.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/stdlib/tdeques.nim b/tests/stdlib/tdeques.nim
index 8a788d337..fcfc278a9 100644
--- a/tests/stdlib/tdeques.nim
+++ b/tests/stdlib/tdeques.nim
@@ -183,6 +183,12 @@ proc main() =
     clear(a)
     doAssert len(a) == 0
 
+  block: # bug #21278
+    var a = [10, 20, 30, 40].toDeque
+
+    a.shrink(fromFirst = 0, fromLast = 1)
+    doAssert $a == "[10, 20, 30]"
+
 
 static: main()
 main()