Megatest

Diff
Login

Differences From Artifact [f3fe558fbc]:

To Artifact [6e4b85d0ba]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
(use test posix srfi-1)
(load "path-glob.scm")

(define globbers `((multi-glob . ,multi-glob)(path-glob . ,path-glob)))
(define interesting-patts '("../*/*" "/*/bin/*" "./*/bin/*"))
(define simple-patts '("../*" "/*" "/bin/*" "." ".." "*"))

(define (trim-list lst)
  (if (> (length lst) 3)
      (append (take lst 3) '(...))
      lst))

(define (generate-prefix patt)
  (write (conc "patt: " patt (make-string (- 10 (string-length patt)) #\ ))))

(print "\nCompare each globber with glob") ;; can only do one level globs here
(for-each
 (lambda (globber)
   (print "\n\nGlobber: " globber)
   (for-each
    (lambda (patt)
      (generate-prefix patt)
      (test #f '() (trim-list
		    (lset-xor string=? ((alist-ref globber globbers) patt)(glob patt)))))
    simple-patts))
 (map car globbers))

(print "\nTest the globbers against patts - only checks for resiliance, not correctness.")
(for-each
 (lambda (patt)
   (generate-prefix patt)(test #f #t (list? (path-glob patt)))
   (generate-prefix patt)(test #f #t (list? (multi-glob patt)))
   )
 interesting-patts)

(print "Compare the globbers")
(for-each
 (lambda (patt)
   (generate-prefix patt)
   (test #f '() (trim-list
		 (lset-xor string=? (path-glob patt)(multi-glob patt)))))
 interesting-patts)

(test-exit)





|












|
















|








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
(use test posix srfi-1)
(load "path-glob.scm")

(define globbers `((multi-glob . ,multi-glob)(path-glob . ,path-glob)))
(define interesting-patts '("../*/*" "/*/bin/*" "./*/bin/*"))
(define simple-patts '("../*" "/*" "/bin/*" "." ".." "*" "a[0-1]*"))

(define (trim-list lst)
  (if (> (length lst) 3)
      (append (take lst 3) '(...))
      lst))

(define (generate-prefix patt)
  (write (conc "patt: " patt (make-string (- 10 (string-length patt)) #\ ))))

(print "\nCompare each globber with glob") ;; can only do one level globs here
(for-each
 (lambda (globber)
   (print "\nGlobber: " globber " vs glob")
   (for-each
    (lambda (patt)
      (generate-prefix patt)
      (test #f '() (trim-list
		    (lset-xor string=? ((alist-ref globber globbers) patt)(glob patt)))))
    simple-patts))
 (map car globbers))

(print "\nTest the globbers against patts - only checks for resiliance, not correctness.")
(for-each
 (lambda (patt)
   (generate-prefix patt)(test #f #t (list? (path-glob patt)))
   (generate-prefix patt)(test #f #t (list? (multi-glob patt)))
   )
 interesting-patts)

(print "\nCompare the globbers against each other")
(for-each
 (lambda (patt)
   (generate-prefix patt)
   (test #f '() (trim-list
		 (lset-xor string=? (path-glob patt)(multi-glob patt)))))
 interesting-patts)

(test-exit)