Test is prefs directory needs to be created

This commit is contained in:
2026-08-26 22:22:38 +02:00
parent f8349e9a11
commit 319d5e9cff
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -43,6 +43,7 @@
(define (ini->file ini file #:private? [private? #f]) (define (ini->file ini file #:private? [private? #f])
(let* ((file (get-ini-file file)) (let* ((file (get-ini-file file))
(_ (make-parent-directory* file))
(out (if (and private? (out (if (and private?
(memq (system-type 'os) '(unix macosx))) (memq (system-type 'os) '(unix macosx)))
(open-output-file file (open-output-file file
@@ -198,4 +199,3 @@
ini))))) ini)))))
+12
View File
@@ -17,3 +17,15 @@
(lambda () (lambda ()
(when (file-exists? tmp) (when (file-exists? tmp)
(delete-file tmp)))) (delete-file tmp))))
(define tmp-dir
(make-temporary-file "simple-ini-parent-~a" 'directory))
(define nested-file
(build-path tmp-dir "preferences" "simple-ini.ini"))
(dynamic-wind
void
(lambda ()
(ini->file (make-ini) nested-file)
(check-true (file-exists? nested-file)))
(lambda ()
(delete-directory/files tmp-dir)))