kzccm1d4if10m2xaz1wqy3xar821pp1r-my-site-anaphoric-git.test.suzanne.soy-0.0.1

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

aand-test.rkt (789B)


      1 #lang racket
      2 
      3 (require anaphoric/aand
      4          rackunit)
      5 
      6 (define lst '(x b 2 y z a b c 1 2 3))
      7 
      8 (check-equal? (aand)
      9               #t)
     10 
     11 (check-equal? (aand #f)
     12               #f)
     13 
     14 (check-equal? (aand (member 'y lst))
     15               '(y z a b c 1 2 3))
     16 
     17 (check-equal? (aand (member 'y lst)
     18                     (member 'b lst)
     19                     (member '2 lst))
     20               '(2 y z a b c 1 2 3))
     21 
     22 (check-equal? (aand (member 'y lst)
     23                     (member 'b lst)
     24                     (member '2 it))
     25               '(2 y z a b c 1 2 3))
     26 
     27 (check-equal? (aand (member 'y lst)
     28                     (member 'b it)
     29                     (member '2 it))
     30               '(2 3))
     31 
     32 (check-equal? (aand (member 'absent lst)
     33                     (fail "aand selected wrong branch"))
     34               #f)