-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rough-draft: ordered collections support using layered implem,entatio…
…n of balanced binary trees
- Loading branch information
Dan Lentz
committed
Mar 21, 2013
1 parent
eff8d1c
commit 21a3a2b
Showing
7 changed files
with
1,174 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
;;;;; -*- mode: common-lisp; common-lisp-style: modern; coding: utf-8; -*- | ||
;;;;; | ||
|
||
(in-package :cl-ctrie-test) | ||
|
||
(defsuite* (cl-ctrie/tree/node :in cl-ctrie/tree)) | ||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;; Node Tests | ||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
|
||
(deftest (check-node-instance-access :auto-call nil) (m) | ||
(is (equalp (pointer:deref m) (vector 'tree:node :k :v :l :r :x))) | ||
(is (eq :k (tree:node/k m))) | ||
(is (eq :v (tree:node/v m))) | ||
(is (eq :l (tree:node/l m))) | ||
(is (eq :r (tree:node/r m))) | ||
(is (eq :x (tree:node/x m))) | ||
(is (equal '(:k :v) (tree:node/kv m))) | ||
(is (equal '(:l :r) (tree:node/lr m))) | ||
(is (equal '(:k :v :l :r) (tree:node/kvlr m))) | ||
(is (equal '(:k :v :l :r :x) (tree:node/kvlrx m))) | ||
(is (equal '(:k :v :l :r :x) (tree:node/constituents m))) | ||
(is (equal '(:k :v :l :r :x) (multiple-value-list (tree:node/values m))))) | ||
|
||
|
||
(deftest check-instance-access/transient-node () | ||
(check-node-instance-access (vector 'tree:node :k :v :l :r :x)) | ||
(check-node-instance-access (make-array 6 :initial-contents | ||
(list 'tree:node :k :v :l :r :x))) | ||
(check-node-instance-access (with-inactive-layers (persistent) | ||
(tree::make-node :k :v :l :r :x)))) | ||
|
||
(deftest check-instance-access/persistent-node () | ||
(check-node-instance-access (mm:make-marray 6 :marray-class 'tree::persistent-node | ||
:initial-contents (list 'tree:node :k :v :l :r :x))) | ||
(check-node-instance-access (with-active-layers (persistent) | ||
(with-inactive-layers (persistent/cache) | ||
(tree::make-node :k :v :l :r :x))))) | ||
|
||
(deftest check-instance-access/persistent-cache-node () | ||
(check-node-instance-access (mm:make-marray 6 :marray-class 'tree::persistent/cache-node | ||
:initial-contents (list 'tree:node :k :v :l :r :x))) | ||
(check-node-instance-access (with-active-layers (persistent/cache) | ||
(tree::make-node :k :v :l :r :x)))) | ||
|
||
|
||
|
Oops, something went wrong.