Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,20 @@
#lang racket/base
;; Racket's `directory-list' produces a sorted list of files
(define (ls) (for-each displayln (directory-list)))
;; Code to run when this file is running directly
(module+ main
(ls))
(module+ test
(require tests/eli-tester racket/port racket/file)
(define (make-directory-tree)
(make-directory* "foo/bar")
(for ([f '("1" "2" "a" "b")])
(with-output-to-file (format "foo/bar/~a"f) #:exists 'replace newline)))
(make-directory-tree)
(define (ls/str dir)
(parameterize ([current-directory dir]) (with-output-to-string ls)))
(test (ls/str "foo") => "bar\n"
(ls/str "foo/bar") => "1\n2\na\nb\n"))