Raymond Toy pushed to branch issue-269-unix-get-user-homedir at cmucl / cmucl
Commits: f642b12f by Raymond Toy at 2023-11-16T18:31:59-08:00 Add simple test for unix:unix-get-user-homedir
- - - - -
1 changed file:
- + tests/os.lisp
Changes:
===================================== tests/os.lisp ===================================== @@ -0,0 +1,21 @@ +(defpackage :os-tests + (:use :cl :lisp-unit)) + +(in-package "OS-TESTS") + +(define-test user-homedir + "Test user-homedir" + (:tag :issues) + ;; Simple test to see if unix-get-user-homedir returns the expected + ;; value. We assume the envvar USERNAME and HOME exist and are + ;; correctly set up for the user running this test. + (let ((user-name (unix:unix-getenv "USERNAME"))) + (assert-true user-name) + (when user-name + (let ((expected-homedir (pathname + (concatenate 'string + (unix:unix-getenv "HOME") + "/"))) + (homedir (unix:unix-get-user-homedir user-name))) + (assert-true expected-homedir) + (assert-equal homedir expected-homedir)))))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/f642b12f9beaf179e93acb53...