mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 22:31:12 +02:00
(mkstemp!): New tests.
This commit is contained in:
parent
d4f76919e6
commit
95c098ddd9
1 changed files with 23 additions and 0 deletions
|
@ -53,6 +53,29 @@
|
|||
;; (execle "./nosuchprog" '("FOO=1" "BAR=2") "./nosuchprog" "some arg")))
|
||||
|
||||
|
||||
;;
|
||||
;; mkstemp!
|
||||
;;
|
||||
|
||||
(with-test-prefix "mkstemp!"
|
||||
|
||||
;; the temporary names used in the tests here are kept to 8 characters so
|
||||
;; they'll work on a DOS 8.3 file system
|
||||
|
||||
(define (string-copy str)
|
||||
(list->string (string->list str)))
|
||||
|
||||
(pass-if-exception "number arg" exception:wrong-type-arg
|
||||
(mkstemp! 123))
|
||||
|
||||
(pass-if "filename string modified"
|
||||
(let* ((template "T-XXXXXX")
|
||||
(str (string-copy template))
|
||||
(port (mkstemp! str))
|
||||
(result (not (string=? str template))))
|
||||
(delete-file str)
|
||||
result)))
|
||||
|
||||
;;
|
||||
;; putenv
|
||||
;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue