mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Added stack_rotate() regressions.
This commit is contained in:
parent
ba4a35229c
commit
94359dbf8c
2 changed files with 18 additions and 8 deletions
|
@ -55,15 +55,25 @@ test_stack_push();
|
||||||
|
|
||||||
|
|
||||||
module test_stack_pop() {
|
module test_stack_pop() {
|
||||||
q = ["Foo", "Bar", "Baz", "Qux"];
|
s = ["Foo", "Bar", "Baz", "Qux"];
|
||||||
q1 = stack_pop(q);
|
s1 = stack_pop(s);
|
||||||
assert(q1 == ["Foo", "Bar", "Baz"]);
|
assert(s1 == ["Foo", "Bar", "Baz"]);
|
||||||
q2 = stack_pop(q,2);
|
s2 = stack_pop(s,2);
|
||||||
assert(q2 == ["Foo", "Bar"]);
|
assert(s2 == ["Foo", "Bar"]);
|
||||||
q3 = stack_pop(q,3);
|
s3 = stack_pop(s,3);
|
||||||
assert(q3 == ["Foo"]);
|
assert(s3 == ["Foo"]);
|
||||||
}
|
}
|
||||||
test_stack_pop();
|
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
|
// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,16];
|
BOSL_VERSION = [2,0,17];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
|
Loading…
Reference in a new issue