From 94359dbf8c0aa14b3cc6adbd8b537d07fcd41add Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Fri, 8 Nov 2019 16:49:46 -0800 Subject: [PATCH] Added stack_rotate() regressions. --- tests/test_stacks.scad | 24 +++++++++++++++++------- version.scad | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/test_stacks.scad b/tests/test_stacks.scad index b32138c..e261093 100644 --- a/tests/test_stacks.scad +++ b/tests/test_stacks.scad @@ -55,15 +55,25 @@ test_stack_push(); module test_stack_pop() { - q = ["Foo", "Bar", "Baz", "Qux"]; - q1 = stack_pop(q); - assert(q1 == ["Foo", "Bar", "Baz"]); - q2 = stack_pop(q,2); - assert(q2 == ["Foo", "Bar"]); - q3 = stack_pop(q,3); - assert(q3 == ["Foo"]); + s = ["Foo", "Bar", "Baz", "Qux"]; + s1 = stack_pop(s); + assert(s1 == ["Foo", "Bar", "Baz"]); + s2 = stack_pop(s,2); + assert(s2 == ["Foo", "Bar"]); + s3 = stack_pop(s,3); + assert(s3 == ["Foo"]); } test_stack_pop(); +module test_stack_rotate() { + s = ["Foo", "Bar", "Baz", "Qux", "Quux"]; + s1 = stack_rotate(s,4); + assert(s1 == ["Foo", "Baz", "Qux", "Quux", "Bar"]); + s2 = stack_rotate(s,-4); + assert(s2 == ["Foo", "Quux", "Bar", "Baz", "Qux"]); +} +test_stack_rotate(); + + // vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap diff --git a/version.scad b/version.scad index cf05edb..040937b 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,16]; +BOSL_VERSION = [2,0,17]; // Section: BOSL Library Version Functions