diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 12:57:03 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-02 19:28:43 +0200 |
commit | bda166e6050f799b4d99574632474f2760b75a21 (patch) | |
tree | 459e220e72a76e5c32c1f4adda188342e1559e4d /tests/test/hnh-util-env.scm | |
parent | test fixes. (diff) | |
download | calp-bda166e6050f799b4d99574632474f2760b75a21.tar.gz calp-bda166e6050f799b4d99574632474f2760b75a21.tar.xz |
Remove accidentially duplicated tests from merge.
Diffstat (limited to '')
-rw-r--r-- | tests/test/hnh-util-env.scm | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/tests/test/hnh-util-env.scm b/tests/test/hnh-util-env.scm index f38a3a3b..c1e0161f 100644 --- a/tests/test/hnh-util-env.scm +++ b/tests/test/hnh-util-env.scm @@ -5,14 +5,11 @@ :use-module ((guile) :select (setenv getenv)) :use-module ((hnh util env) :select (let-env))) +(setenv "CALP_TEST_ENV" "1") -(test-group "let-env" - (setenv "CALP_TEST_ENV" "1") - - (test-equal - "Ensure we have set value beforehand" - "1" - (getenv "CALP_TEST_ENV")) +(test-equal "Ensure we have set value beforehand" + "1" + (getenv "CALP_TEST_ENV")) (let-env ((CALP_TEST_ENV "2")) @@ -26,24 +23,25 @@ "1" (getenv "CALP_TEST_ENV")) - (catch 'test-error - (lambda () - (let-env - ((CALP_TEST_ENV "2")) - (test-equal - "Test our local override again" - "2" - (getenv "CALP_TEST_ENV")) - (throw 'test-error))) - list) - - (test-equal - "Test restoration after non-local exit" - "1" - (getenv "CALP_TEST_ENV"))) - -(test-group "with-working-directory" - 'TODO) - -(test-group "with-locale" - 'TODO) +(catch 'test-error + (lambda () + (let-env + ((CALP_TEST_ENV "2")) + (test-equal + "Test our local override again" + "2" + (getenv "CALP_TEST_ENV")) + (throw 'test-error))) + list) + +(test-equal + "Test restoration after non-local exit" + "1" + (getenv "CALP_TEST_ENV")) + + +(test-group "Unsetting environment" + (setenv "TEST" "A") + (let-env ((TEST #f)) + (test-assert (not (getenv "TEST")))) + (test-equal "A" (getenv "TEST"))) |