diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-08 11:29:21 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-08 11:29:21 +0200 |
commit | d8a52af2520d14035fc3a36a7aa3569f9856380a (patch) | |
tree | d4ef88ad3fec5acb40581c2d4d048b2a7ca11eae /tests/unit/util/atomic-stack.scm | |
parent | Repair litmus test. (diff) | |
download | calp-d8a52af2520d14035fc3a36a7aa3569f9856380a.tar.gz calp-d8a52af2520d14035fc3a36a7aa3569f9856380a.tar.xz |
Further rewrite of testrunner.
Move many of the atomic procedures into proper libraries.
Diffstat (limited to 'tests/unit/util/atomic-stack.scm')
-rw-r--r-- | tests/unit/util/atomic-stack.scm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/util/atomic-stack.scm b/tests/unit/util/atomic-stack.scm new file mode 100644 index 00000000..46a16bfb --- /dev/null +++ b/tests/unit/util/atomic-stack.scm @@ -0,0 +1,25 @@ +(define-module (test atomic-stack) + :use-module (srfi srfi-64) + :use-module (srfi srfi-88) + :use-module (hnh util atomic-stack)) + +(define stack (atomic-stack)) + +(test-equal "Fresh stacks are empty" + '() (stack->list stack)) + +(push! 1 stack) +(push! 2 stack) +(push! 3 stack) + +(test-equal "Stack contents when content" + '(3 2 1) (stack->list stack)) + +(test-equal "Poped correctly 3" 3 (pop! stack)) +(push! 4 stack) +(test-equal "Poped correctly 4" 4 (pop! stack)) +(test-equal "Poped correctly 2" 2 (pop! stack)) +(test-equal "Poped correctly 1" 1 (pop! stack)) +(test-equal "Poped correctly #f" #f (pop! stack)) + +'((hnh util atomic-stack)) |