fix 2htdp/image for text-only mode and add a test case that

covers improvements from 8fb8f56
This commit is contained in:
Robby Findler 2014-04-06 08:37:23 -05:00
parent 56d0aad9fc
commit e08ffde1b5
2 changed files with 6 additions and 2 deletions

View File

@ -10,5 +10,8 @@
(class* object% (snip-reader<%>)
(define/public (read-header vers stream) (void))
(define/public (read-snip text? cvers stream)
(snipclass-bytes->image (send stream read-raw-bytes '2htdp/image)))
(define bytes (send stream read-raw-bytes '2htdp/image))
(if text?
#"."
(snipclass-bytes->image bytes)))
(super-new))))

View File

@ -2567,7 +2567,8 @@
(test (equal? (image-baseline (list-ref washed 2))
(image-height (list-ref washed 2)))
=>
#f))
#f)
(test washed => (list img1 img2 img3)))
(test (convertible? (circle 20 "solid" "red")) => #t)
(test (bytes? (convert (circle 20 "solid" "red") 'png-bytes)) => #t)