Files
sex/tests/module-path.scm
alex-eg a048925c7a resolve a relative SEX_MODULE_PATH entry from the working directory
make-absolute-pathname with no directory of its own put `src' under
the root, so SEX_MODULE_PATH=src searched /src/.

Fixes #48.
2026-10-14 19:22:34 +03:00

23 lines
817 B
Scheme

;;; Where imports are looked for. SEX_MODULE_PATH is read once, at the
;;; start, from the directory sexc was started in.
(import (chicken pathname)
(chicken process-context)
sex-modules)
(test-group "module path"
;; make-absolute-pathname took `src' for a directory under the root,
;; and an import searched /src/
(set-environment-variable! "SEX_MODULE_PATH" "src:/abs/lib")
(load-persistent-module-paths)
(test "a relative entry is from the working directory"
(make-absolute-pathname (current-directory) "src")
(second (get-module-paths)))
(test "an absolute one is as written"
"/abs/lib"
(third (get-module-paths)))
(set-environment-variable! "SEX_MODULE_PATH" "")
(load-persistent-module-paths)
(unset-environment-variable! "SEX_MODULE_PATH"))