Initial import

This commit is contained in:
2026-08-08 14:32:18 +02:00
parent be2baa9280
commit f32503f3e7
11 changed files with 689 additions and 76 deletions
+31
View File
@@ -0,0 +1,31 @@
#lang racket
(require rackunit
racket/file
(only-in racket-makefile rm-f rm-rf cleanup))
(define tmp (make-temporary-file "racket-makefile-test~a" 'directory))
(dynamic-wind
void
(lambda ()
(define file (build-path tmp "x.tmp"))
(call-with-output-file file (lambda (out) (display "x" out)))
(check-true (file-exists? file))
(rm-f file)
(check-false (file-exists? file))
(define nested (build-path tmp "a" "b"))
(make-directory* nested)
(define html (build-path nested "x.html"))
(define txt (build-path nested "x.txt"))
(call-with-output-file html (lambda (out) (display "html" out)))
(call-with-output-file txt (lambda (out) (display "txt" out)))
(cleanup tmp '("**.html"))
(check-false (file-exists? html))
(check-true (file-exists? txt))
(rm-rf (build-path tmp "a"))
(check-false (directory-exists? (build-path tmp "a"))))
(lambda ()
(delete-directory/files tmp #:must-exist? #f)))