Re: stack.e functions
- Posted by Jeremy Cowgar <jeremy at cowga?.co?> May 04, 2008
- 593 views
Larry Miller wrote: > > I was looking at the functions defined in stack.e on SourceForge and found 2 > problems. push() will not word properly if value is a sequence. dup() will not > work properly if the top element is a sequence. > > The corrected functions: Thanks Larry! This is what the standard libraries are all about! I added a few tests to exploit the bug you found:
sk = s:push(sk, {10,20}) test_equal("FIFO push sequence #1", {FILO, {10,20}}, sk) sk = s:push(sk, {30,40}) test_equal("FIFO push sequence #3", {FILO, {10,20},{30,40}}, sk) sk = s:dup(sk) test_equal("FIFO dup sequence", {FILO, {10,20},{30,40},{30,40}}, sk)
I then applied replaced the dup and push functions with your variants and all tests pass again. The changes have been committed to SVN. 579 tests run, 579 passed, 0 failed, 100% success -- Jeremy Cowgar http://jeremy.cowgar.com