www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit d87b895cb1f0fcb8cb3e9ab38882a49c77399e1c
parent facf11a6153478c4a1ac89309aa0fe96118d09b8
Author: Georges Dupéron <georges.duperon@gmail.com>
Date:   Thu, 12 Jan 2017 19:49:57 +0100

Suppress unwanted output in tests

Diffstat:
Mtest/test-map.rkt | 36++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/test/test-map.rkt b/test/test-map.rkt @@ -28,19 +28,22 @@ (void)) ;; with ann -(ann (map (λ (x) (* x 2)) '()) Null) -(ann (map (λ (x) (* x 2)) '(1)) (Listof Positive-Byte)) -(ann (map (λ (x) (* x 2)) '(1 2)) (Listof Positive-Index)) -(ann (map (λ (x) (* x 2)) '(1 2 3)) (Listof Positive-Index)) -(ann (map + '(1 2 3) '(4 5 6)) (Listof Positive-Index)) -(ann (map car '((1 2) (3 4))) (Listof Positive-Byte)) -(ann (map #λ(+ % 1) '(1 2 3)) (Listof Positive-Index)) +(let () + (ann (map (λ (x) (* x 2)) '()) Null) + (ann (map (λ (x) (* x 2)) '(1)) (Listof Positive-Byte)) + (ann (map (λ (x) (* x 2)) '(1 2)) (Listof Positive-Index)) + (ann (map (λ (x) (* x 2)) '(1 2 3)) (Listof Positive-Index)) + (ann (map + '(1 2 3) '(4 5 6)) (Listof Positive-Index)) + (ann (map car '((1 2) (3 4))) (Listof Positive-Byte)) + (ann (map #λ(+ % 1) '(1 2 3)) (Listof Positive-Index)) + + (ann (map (λ (x) (define y x) (+ y 1)) '(1 2 3)) (Listof Positive-Index)) -(ann (map (λ (x) (define y x) (+ y 1)) '(1 2 3)) (Listof Positive-Index)) + (ann (λ #:∀ (A) ([l : (Listof A)]) + (map (λ (x) x) l)) + (∀ (A) (→ (Listof A) (Listof A)))) -(ann (λ #:∀ (A) ([l : (Listof A)]) - (map (λ (x) x) l)) - (∀ (A) (→ (Listof A) (Listof A)))) + (void)) ;; with check-equal? (check-equal? (map (λ (x) (* x 2)) '()) '()) @@ -98,11 +101,12 @@ ;; Does not work because the inferred type changes between the first and the ;; second iteration #;(check-equal? (foldl (λ (x acc) (cons acc (add1 x))) '() '(1 2 3)) - '(4 (3 (2)))) -(foldl (λ (x [acc : (Rec R (U Null (Pairof R Positive-Index)))]) - (cons acc (add1 x))) - '() - '(1 2 3)) + '(((() . 4) . 3) . 2)) +(check-equal? (foldl (λ (x [acc : (Rec R (U Null (Pairof R Positive-Index)))]) + (cons acc (add1 x))) + '() + '(1 2 3)) + '(((() . 4) . 3) . 2)) (let () (ann (foldl (λ (x acc) (cons (add1 x) acc)) '() '()) Null)