~ chicken-core (chicken-5) /tests/repository-path.scm
Trap1(import (chicken platform)
2 (chicken process-context)
3 (chicken condition))
4
5(include "test.scm")
6
7(test-equal "find-file on #f"
8 (chicken.load#find-file "repository-path.scm" #f)
9 #f)
10
11(test-equal "find-file on string"
12 (chicken.load#find-file "repository-path.scm" ".")
13 "./repository-path.scm")
14
15(test-equal "find-file on list"
16 (chicken.load#find-file "repository-path.scm" '(".." "."))
17 "./repository-path.scm")
18
19(test-equal "(repository-path) is populated by CHICKEN_REPOSITORY_PATH"
20 (repository-path)
21 (command-line-arguments))
22
23(repository-path
24 (cons (get-environment-variable "CHICKEN_INSTALL_REPOSITORY")
25 (repository-path)))
26
27(test-assert "setting (repository-path) and loading a library"
28 (handle-exceptions exn #f (begin (require-library sample-module) #t)))
29
30(test-error "Putting garbage in (repository-path)"
31 (repository-path '(foo)))
32
33(test-exit)