Adding zo size reporter test
This commit is contained in:
parent
c9ded2d99b
commit
a8b0a7dce6
|
@ -1900,6 +1900,7 @@ path/s is either such a string or a list of them.
|
|||
"collects/tests/xml" responsible (jay)
|
||||
"collects/tests/xml/test-clark.rkt" drdr:command-line #f drdr:timeout 300
|
||||
"collects/tests/xml/xml-snip-bug.rkt" drdr:command-line (gracket "-t" *)
|
||||
"collects/tests/zo-size.rkt" responsible (jay)
|
||||
"collects/tex2page" responsible (jay)
|
||||
"collects/texpict" responsible (mflatt robby)
|
||||
"collects/texpict/balloon.rkt" drdr:command-line (gracket-text "-t" *)
|
||||
|
|
29
collects/tests/zo-size.rkt
Normal file
29
collects/tests/zo-size.rkt
Normal file
|
@ -0,0 +1,29 @@
|
|||
#lang racket/base
|
||||
(require racket/path
|
||||
racket/match)
|
||||
|
||||
(define (indent i)
|
||||
(for ([t (in-range i)])
|
||||
(printf "|")))
|
||||
|
||||
(define (dir-zo-size i p)
|
||||
(parameterize ([current-directory p])
|
||||
(define subdir? #f)
|
||||
(define (has-sub-dir!)
|
||||
(unless subdir?
|
||||
(indent i) (printf "~a:\n" p)
|
||||
(set! subdir? #t)))
|
||||
(define tot
|
||||
(for/fold ([size 0])
|
||||
([p (in-list (directory-list))])
|
||||
(+
|
||||
(match p
|
||||
[(? directory-exists?) (has-sub-dir!) (dir-zo-size (add1 i) p)]
|
||||
[(app filename-extension #"zo") (file-size p)]
|
||||
[else 0])
|
||||
size)))
|
||||
(unless (zero? tot)
|
||||
(indent i) (printf "~a: ~a\n" p tot))
|
||||
tot))
|
||||
|
||||
(void (dir-zo-size 0 (simplify-path (build-path (collection-path "racket") 'up))))
|
Loading…
Reference in New Issue
Block a user