[cl-containers-devel] Problems with priority queues
Josip Gracin
gracin at tel.fer.hr
Mon Oct 22 11:02:28 UTC 2007
Hi Gary!
It's me and my queues again. :-) Here's a test that fails on Containers
version 0.9.8, i.e. the latest from asdf-install. I've created a
separate test file for priority queues so that you can easily add it to
the test suite, if you like.
------------------------------------------------------------
tests/test-prio-queue.lisp
------------------------------------------------------------
(in-package #:cl-containers-test)
(deftestsuite test-prio-queue ()
((q (make-instance 'priority-queue-on-container
:sorter #'string<
:test #'string=))))
(deftestsuite test-delete-prio-queue (test-prio-queue)
()
(:setup (insert-item q "a")
(insert-item q "b")
(insert-item q "c")))
(addtest (test-delete-prio-queue)
delete-first-1
(delete-first q)
(ensure-same (first-element q) "b")
(delete-first q)
(ensure-same (first-element q) "c"))
--------------------------------------------------------------
Not calling ELEMENT in queues.lisp:76 solves the problem.
More information about the cl-containers-devel
mailing list