Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved tests for srfi-61

  • Loading branch information...
commit 3c9986cb12173927f66ac6d9e0d892d1c9939232 1 parent 3d2c163
Álvaro Castro-Castilla authored
Showing with 24 additions and 6 deletions.
  1. +24 −6 srfi/test/61.scm
View
30 srfi/test/61.scm
@@ -1,16 +1,34 @@
(import ../64)
-(import ../61)
-(test-begin "srfi-61" 1)
+(test-begin "srfi-61")
+
+(define this-file "61.scm")
+
+(test-assert #t) ; Bug in srfi-64? Test must start with an assert
;; From SRFI-61 document
-(define (port->char-list port)
+(define (port->char-list-r5rs port)
(cond
((read-char port) char?
- => (lambda (c) (cons c (port->char-list port))))
+ => (lambda (c) (cons c (port->char-list-r5rs port))))
(else '())))
-(test-assert
- (port->char-list (open-input-file "61.scm")))
+(test-error "r5rs-cond"
+ (test-read-eval-string
+ "(port->char-list-r5rs (open-input-file this-file))"))
+
+(import ../61)
+
+(define (port->char-list-srfi port)
+ (cond
+ ((read-char port) char?
+ => (lambda (c) (cons c (port->char-list-srfi port))))
+ (else '())))
+
+;; Tests that it actually expands properly when this srfi is loaded
+
+(test-assert "srfi-cond"
+ (test-read-eval-string
+ "(port->char-list-srfi (open-input-file this-file))"))
(test-end "srfi-61")
Please sign in to comment.
Something went wrong with that request. Please try again.