Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Rob Hunter authored November 14, 2008
9  unit-test.ss
... ...
@@ -1,12 +1,15 @@
1 1
 #lang scheme
  2
+
2 3
 (require (planet "main.ss" ("schematics" "schemeunit.plt" 3 (= 3)))
3  
-         (planet "text-ui.ss" ("schematics" "schemeunit.plt" 3 (= 3))))
  4
+         (planet "text-ui.ss" ("schematics" "schemeunit.plt" 3 (= 3)))
  5
+         "util.scm")
4 6
                  
5 7
 (define basic-tests
6 8
   (test-suite
7 9
    "LeftParen basic test suite"
8  
-   ;;                              actual:  expected:
9  
-   (test-equal? "numeric equality" 1        2        )
  10
+   ;;                              actual:        expected:
  11
+   (test-equal? "numeric equality" 1              1        )
  12
+   (test-equal? "md5 hashing"      (md5 "hello")  "5d41402abc4b2a76b9719d911017c592")
10 13
    ))
11 14
 
12 15
 (run-tests basic-tests)
1  user.scm
... ...
@@ -1,7 +1,6 @@
1 1
 #lang scheme/base
2 2
 
3 3
 (require "util.scm"
4  
-         (planet "digest.ss" ("soegaard" "digest.plt" 1 (= 2)))
5 4
          "form.scm"
6 5
          "repository.scm"
7 6
          "record.scm"
10  util.scm
@@ -22,7 +22,9 @@
22 22
          (planet "web.scm" ("soegaard" "web.plt" 2 1)) ; XXX get rid of this dependency
23 23
          (lib "unit.ss")
24 24
 
25  
-         srfi/27
  25
+         (only-in  file/md5
  26
+                   (md5 md5-bytes))
  27
+         
26 28
          )
27 29
 
28 30
 (provide first
@@ -37,7 +39,6 @@
37 39
          replace-i
38 40
          transform-i
39 41
          iota
40  
-;         for
41 42
          zip
42 43
          unzip1
43 44
          unzip2
@@ -151,6 +152,8 @@
151 152
 
152 153
          sync-on-lock
153 154
          make-lock
  155
+
  156
+         md5
154 157
          )
155 158
 
156 159
 (define (random-choice lst)
@@ -570,6 +573,9 @@
570 573
 (define (make-lock)
571 574
   (make-semaphore 1))
572 575
 
  576
+(define (md5 str)
  577
+  (bytes->string/utf-8 (md5-bytes (string->bytes/utf-8 str))))
  578
+
573 579
 ;; pretty printing:
574 580
 (print-hash-table #t)
575 581
 (print-struct #t)

0 notes on commit 9ebdbfb

Please sign in to comment.
Something went wrong with that request. Please try again.