in the middle of repairing bugs in hashcode

This commit is contained in:
Danny Yoo 2011-11-04 13:57:14 -04:00
parent 3066822ad0
commit 6b20b6e1fc

View File

@ -2,16 +2,18 @@
(require (planet dyoo/whalesong/lang/private/shared)) (require (planet dyoo/whalesong/lang/private/shared))
;; boxes ;; boxes
"boxes"
(equal-hash-code (box 42)) (equal-hash-code (box 42))
;; bytes ;; bytes
"bytes"
(equal-hash-code #"testing") (equal-hash-code #"testing")
;; chars ;; chars
"chars"
(equal-hash-code #\A) (equal-hash-code #\A)
(equal-hash-code #\B) (equal-hash-code #\B)
;; hashes ;; hashes
"hashes"
(equal-hash-code (make-hash '((1 . x) (equal-hash-code (make-hash '((1 . x)
(2 . y) (2 . y)
(3 . z)))) (3 . z))))
@ -24,6 +26,7 @@
; ;
;; lists ;; lists
"lists"
(equal-hash-code (list 1 2 3 4 5)) (equal-hash-code (list 1 2 3 4 5))
(equal-hash-code (shared ([a (cons 1 b)] (equal-hash-code (shared ([a (cons 1 b)]
[b (cons 2 a)]) [b (cons 2 a)])
@ -36,16 +39,21 @@
;; ;;
;; strings ;; strings
"strings"
(equal-hash-code "Hello world") (equal-hash-code "Hello world")
;; structs ;; structs
"structs"
(define-struct thing (name age) #:mutable) (define-struct thing (name age) #:mutable)
(equal-hash-code (make-thing "danny" 32)) (equal-hash-code (make-thing "danny" 32))
(equal-hash-code (shared ([a (make-thing a a)]) a)) (equal-hash-code (shared ([a (make-thing a a)]) a))
;; symbols ;; symbols
"symbols"
(equal-hash-code 'hello) (equal-hash-code 'hello)
(equal-hash-code 'world)
;; vectors ;; vectors
"vectors"
(equal-hash-code #(1 2 3 4 5)) (equal-hash-code #(1 2 3 4 5))
(equal-hash-code (shared ([v (vector 1 2 v 3 v)]) v)) (equal-hash-code (shared ([v (vector 1 2 v 3 v)]) v))