comparison tests/automated/mule-tests.el @ 4465:732b87cfabf2

Document Win32 symlink behaviour; adjust tests to take it into a/c. src/ChangeLog addition: 2008-05-21 Aidan Kehoe <kehoea@parhasard.net> * fileio.c (Fmake_symbolic_link): Document behaviour when the underlying OS doesn't support symbolic links. tests/ChangeLog addition: 2008-05-21 Aidan Kehoe <kehoea@parhasard.net> * automated/mule-tests.el (featurep): Make sure that working symlinks are available before testing their functionality. Also, don't bomb out on deleting the other temporary files if deleting the first threw an error.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 21 May 2008 16:55:14 +0200
parents e5b3c4dbc8a2
children c95c06ee1e9d
comparison
equal deleted inserted replaced
4464:61aff09a7589 4465:732b87cfabf2
370 ;; make-temp-name does stat(), which on OS X requires that you 370 ;; make-temp-name does stat(), which on OS X requires that you
371 ;; normalise, where open() will normalise for you. Previously we 371 ;; normalise, where open() will normalise for you. Previously we
372 ;; used scaron as the Latin-2 character, and make-temp-name errored 372 ;; used scaron as the Latin-2 character, and make-temp-name errored
373 ;; on OS X. LATIN CAPITAL LETTER D WITH STROKE does not decompose. 373 ;; on OS X. LATIN CAPITAL LETTER D WITH STROKE does not decompose.
374 (name1 (make-temp-name prefix)) 374 (name1 (make-temp-name prefix))
375 (name2 (make-temp-name prefix))) 375 (name2 (make-temp-name prefix))
376 ;; This is how you suppress output from `message', called by `write-region' 376 (name3 (make-temp-name prefix))
377 working-symlinks)
377 (Assert (not (equal name1 name2))) 378 (Assert (not (equal name1 name2)))
378 (Assert (not (file-exists-p name1))) 379 (Assert (not (file-exists-p name1)))
380 ;; This is how you suppress output from `message', called by `write-region'
379 (Silence-Message 381 (Silence-Message
380 (write-region (point-min) (point-max) name1)) 382 (write-region (point-min) (point-max) name1))
381 (Assert (file-exists-p name1)) 383 (Assert (file-exists-p name1))
382 (when (fboundp 'make-symbolic-link) 384 (Silence-Message
385 (write-region (point-min) (point-max) name3))
386 (Assert (file-exists-p name3))
387 (condition-case nil
388 (make-symbolic-link name1 name3)
389 (file-already-exists
390 ;; If we actually have functioning symlinks, we end up here, since
391 ;; name3 already exists and OK-IF-ALREADY-EXISTS was not specified.
392 (setq working-symlinks t)))
393 (when working-symlinks
383 (make-symbolic-link name1 name2) 394 (make-symbolic-link name1 name2)
384 (Assert (file-exists-p name2)) 395 (Assert (file-exists-p name2))
385 (Assert (equal (file-truename name2) name1)) 396 (Assert (equal (file-truename name2) name1))
386 (Assert (equal (file-truename name1) name1))) 397 (Assert (equal (file-truename name1) name1)))
387 (ignore-file-errors (delete-file name1) (delete-file name2))) 398 (ignore-file-errors (delete-file name1))
399 (ignore-file-errors (delete-file name2))
400 (ignore-file-errors (delete-file name3)))
388 401
389 ;; Add many more file operation tests here... 402 ;; Add many more file operation tests here...
390 403
391 ;;--------------------------------------------------------------- 404 ;;---------------------------------------------------------------
392 ;; Test Unicode-related functions 405 ;; Test Unicode-related functions