Skip to content

Commit

Permalink
got rid of dependency on digest planet lib (to address http://planet.…
Browse files Browse the repository at this point in the history
…plt-scheme.org/trac/ticket/102) and added appropriate unit test
  • Loading branch information
rob7hunter committed Nov 14, 2008
1 parent e1dce07 commit 9ebdbfb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
9 changes: 6 additions & 3 deletions unit-test.ss
@@ -1,12 +1,15 @@
#lang scheme

(require (planet "main.ss" ("schematics" "schemeunit.plt" 3 (= 3)))
(planet "text-ui.ss" ("schematics" "schemeunit.plt" 3 (= 3))))
(planet "text-ui.ss" ("schematics" "schemeunit.plt" 3 (= 3)))
"util.scm")

(define basic-tests
(test-suite
"LeftParen basic test suite"
;; actual: expected:
(test-equal? "numeric equality" 1 2 )
;; actual: expected:
(test-equal? "numeric equality" 1 1 )
(test-equal? "md5 hashing" (md5 "hello") "5d41402abc4b2a76b9719d911017c592")
))

(run-tests basic-tests)
1 change: 0 additions & 1 deletion user.scm
@@ -1,7 +1,6 @@
#lang scheme/base

(require "util.scm"
(planet "digest.ss" ("soegaard" "digest.plt" 1 (= 2)))
"form.scm"
"repository.scm"
"record.scm"
Expand Down
10 changes: 8 additions & 2 deletions util.scm
Expand Up @@ -22,7 +22,9 @@
(planet "web.scm" ("soegaard" "web.plt" 2 1)) ; XXX get rid of this dependency
(lib "unit.ss")

srfi/27
(only-in file/md5
(md5 md5-bytes))

)

(provide first
Expand All @@ -37,7 +39,6 @@
replace-i
transform-i
iota
; for
zip
unzip1
unzip2
Expand Down Expand Up @@ -151,6 +152,8 @@

sync-on-lock
make-lock

md5
)

(define (random-choice lst)
Expand Down Expand Up @@ -570,6 +573,9 @@
(define (make-lock)
(make-semaphore 1))

(define (md5 str)
(bytes->string/utf-8 (md5-bytes (string->bytes/utf-8 str))))

;; pretty printing:
(print-hash-table #t)
(print-struct #t)
Expand Down

0 comments on commit 9ebdbfb

Please sign in to comment.