Megatest

Check-in [a7f72a923a]
Login
Overview
Comment:Added test for the path-glob
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.65
Files: files | file ages | folders
SHA1: a7f72a923ae16e361ae18fc8473754ea2de4b1da
User & Date: mrwellan on 2019-11-22 09:17:13
Other Links: branch diff | manifest | tags
Context
2019-11-22
12:54
Improved the path glob tests check-in: c522956909 user: mrwellan tags: v1.65
09:17
Added test for the path-glob check-in: a7f72a923a user: mrwellan tags: v1.65
2019-11-21
18:38
Added alt version of multi-glob from Robert. check-in: 80a94ea109 user: matt tags: v1.65
Changes

Name change from multi-glob.scm to path-glob/path-glob.scm.

Added path-glob/test.scm version [f3fe558fbc].













































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)