Skip to content

Commit

Permalink
Add +ht tests not impl
Browse files Browse the repository at this point in the history
  • Loading branch information
DurhamSmith committed Oct 1, 2020
1 parent 93f6221 commit 2bed779
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*~
*.fasl
/tmp
/tmp
*.oxdna
*.top
5 changes: 5 additions & 0 deletions ht-helpers.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(in-package :small)

(defun +ht (ht v &key k)
"Adds v to ht under key k. If no k, k=(concatenate 'string (type-of v) #vs-in-ht)"
)
1 change: 1 addition & 0 deletions packages.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#:on-v3-axis
#:bounds
#:write-list ; MISC
#:+ht ;hash table stuff
#:oxdna->file
#:chem-obj ; CHEM-OBJ related
#:set-parent
Expand Down
1 change: 1 addition & 0 deletions small.asd
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
:serial t
:components ((:file "package")
(:file "linear-algebra-tests")
(:file "ht-helpers-tests")
(:file "chem-obj-tests")
(:file "dna-nt-tests")
;; (:file "dna-tile-tests")
Expand Down
14 changes: 14 additions & 0 deletions tests/ht-helpers-tests.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(in-package :small-tests)

(define-test "+ht"
(let ((ht (make-hash-table))
(ans (list "DNA-NT 0" "DNA-NT 1" "DNA-NT 2"
"DNA-NT 3" "DNA-NT 4" "DNA-NT 5")))
(loop for i from 0 to 5 do
(+ht ht (make-dna-nt))
;; (format t "~& ~A ~%" (alexandria:hash-table-keys ht))))

(is equal ans (alexandria:hash-table-keys ht)))))



0 comments on commit 2bed779

Please sign in to comment.