]> gitweb.factorcode.org Git - factor.git/blob - core/namespaces/namespaces-tests.factor
a7b1e508807893b6492aa0581f78b34b889be838
[factor.git] / core / namespaces / namespaces-tests.factor
1 USING: kernel namespaces tools.test words ;
2 IN: namespaces.tests
3
4 H{ } clone "test-namespace" set
5
6 : test-namespace ( -- ? )
7     H{ } clone dup [ namespace = ] bind ;
8
9 [ t ] [ test-namespace ] unit-test
10
11 10 "some-global" set
12 [ f ]
13 [ H{ } clone [ f "some-global" set "some-global" get ] bind ]
14 unit-test
15
16 SYMBOL: test-initialize
17
18 f test-initialize set-global
19
20 test-initialize [ 1 ] initialize
21 test-initialize [ 2 ] initialize
22
23 [ 1 ] [ test-initialize get-global ] unit-test
24
25 f test-initialize set-global
26 test-initialize [ 5 ] initialize
27
28 [ 5 ] [ test-initialize get-global ] unit-test