commit b3ed4134c8a8c85c9bcd7f1055e35bc8fca7006c from: cage date: Thu Jan 20 17:37:31 2022 UTC - [regress-extra] refactored test related to file moving or truncation. commit - f55ab68b8ccd0c8d7fe509f6949f6e65bf77c93b commit + b3ed4134c8a8c85c9bcd7f1055e35bc8fca7006c blob - 0bf55b34170d2031d84dbada100aeab790ad7505 blob + aa0c502d48da1b9878d15beea6e63c0e8b281db2 --- regress/lisp/9p-test/kami-tests.lisp +++ regress/lisp/9p-test/kami-tests.lisp @@ -565,12 +565,14 @@ (root-fid (mount stream root))) (move-file stream root-fid from to) (path-exists-p stream root-fid from)))) + +(defun renamed-filename () + (concatenate 'string *remote-test-path-huge* "-renamed")) (deftest test-move-file ((kami-suite) (test-copy-file)) - (assert-false (example-move-file *remote-test-path-huge* - (concatenate 'string - *remote-test-path-huge* - "-renamed")))) + (assert-false (example-move-file *remote-test-path-huge* (renamed-filename)))) + +(alexandria:define-constant +truncate-size+ 128 :test #'=) (defun example-truncate-file (path &optional (root "/")) (with-open-ssl-stream (stream @@ -581,12 +583,10 @@ *certificate-key*) (let* ((*messages-sent* ()) (root-fid (mount stream root))) - (truncate-file stream root-fid path :new-size 128) + (truncate-file stream root-fid path :new-size +truncate-size+) (stat-size (path-info stream root-fid path))))) (deftest test-truncate-file ((kami-suite) (test-move-file)) (assert-equality #'= - 128 - (example-truncate-file (concatenate 'string - *remote-test-path-huge* - "-renamed")))) + +truncate-size+ + (example-truncate-file (renamed-filename))))