]> gitweb.factorcode.org Git - factor.git/blob - basis/environment/environment-tests.factor
37173031755f4f52afbf0081129abfac06d26974
[factor.git] / basis / environment / environment-tests.factor
1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel namespaces prettyprint system tools.test
4 environment strings sequences ;
5 IN: environment.tests
6
7 os wince? [
8     [ ] [ os-envs . ] unit-test
9
10     os unix? [
11         [ ] [ os-envs "envs" set ] unit-test
12         [ ] [ { { "A" "B" } } set-os-envs ] unit-test
13         [ "B" ] [ "A" os-env ] unit-test
14         [ ] [ "envs" get set-os-envs ] unit-test
15         [ t ] [ os-envs "envs" get = ] unit-test
16     ] when
17
18     [ ] [ "factor-test-key-1" unset-os-env ] unit-test
19     [ ] [ "ps3" "factor-test-key-1" set-os-env ] unit-test
20     [ "ps3" ] [ "factor-test-key-1" os-env ] unit-test
21     [ ] [ "factor-test-key-1" unset-os-env ] unit-test
22     [ f ] [ "factor-test-key-1" os-env ] unit-test
23
24     [ ] [
25         32766 CHAR: a <string> "factor-test-key-long" set-os-env
26     ] unit-test
27     [ 32766 ] [ "factor-test-key-long" os-env length ] unit-test
28     [ ] [ "factor-test-key-long" unset-os-env ] unit-test
29 ] unless