Skip to content

Commit

Permalink
test: add a regression test for data/splay-tree
Browse files Browse the repository at this point in the history
This test is due to @soegaard in #30.
  • Loading branch information
sorawee committed Jan 7, 2024
1 parent 8c1ed65 commit 0f85d3c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions data-test/tests/data/ordered-dict.rkt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#lang racket/base
(require rackunit
rackunit/text-ui
racket/contract
racket/dict
data/skip-list
Expand Down Expand Up @@ -358,3 +359,16 @@ Conclusions:
- in-dict-keys is slow for splay trees
|#

;; regression test

(printf "== regression tests\n")
(run-tests
(test-suite "splay-tree"
(test-case "splay-tree->list"
(define t (make-splay-tree))
(splay-tree-set! t 1 'a)
(splay-tree-set! t 2 'b)
(splay-tree-set! t 3 'c)
(check-equal? (splay-tree->list t)
'((1 . a) (2 . b) (3 . c))))))

0 comments on commit 0f85d3c

Please sign in to comment.