Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

got rid of dependency on digest planet lib (to address http://planet.…

…plt-scheme.org/trac/ticket/102) and added appropriate unit test
  • Loading branch information...
commit 9ebdbfbdea0ec21b0a1092b9890cc62afd704984 1 parent e1dce07
@vegashacker authored
Showing with 14 additions and 6 deletions.
  1. +6 −3 unit-test.ss
  2. +0 −1  user.scm
  3. +8 −2 util.scm
View
9 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)
View
1  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"
View
10 util.scm
@@ -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
@@ -37,7 +39,6 @@
replace-i
transform-i
iota
-; for
zip
unzip1
unzip2
@@ -151,6 +152,8 @@
sync-on-lock
make-lock
+
+ md5
)
(define (random-choice lst)
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.