3
3
Author: "Peter W A Wood, Oldes"
4
4
File: %module-test.r3
5
5
Tabs: 4
6
- Needs: %../ quick-test-module.r3
6
+ Needs: quick-test
7
7
]
8
8
9
9
~~~start-file~~~ "module!"
@@ -17,11 +17,11 @@ supplement system/options/module-paths join what-dir %units/files/
17
17
--test-- "hidden"
18
18
;@@ https://github.com/Oldes/Rebol-issues/issues/1696
19
19
--assert all [
20
- [a] = words-of m: module [] [a: 1 ]
20
+ [local-lib a] = words-of m: module [] [a: 1 ]
21
21
m/a = 1
22
22
]
23
23
--assert all [
24
- [b] = words-of m: module [] [hidden a: 1 b : does [a + 1 ]]
24
+ [local-lib b] = words-of m: module [] [hidden a: 1 b : does [a + 1 ]]
25
25
error? try [m/a ]
26
26
m/b = 2
27
27
]
@@ -263,6 +263,11 @@ probe all [
263
263
e/id = 'needs
264
264
]
265
265
--assert module? m: try [import/version m-1687 1.0.0]
266
+ --assert all [
267
+ ;@@ https://github.com/Oldes/Rebol-wishes/issues/13
268
+ object? m/local-lib
269
+ empty? m/local-lib ; because there was no import in this module
270
+ ]
266
271
267
272
--test-- "import/check"
268
273
;@@ https://github.com/Oldes/Rebol-issues/issues/1686
@@ -297,27 +302,37 @@ probe all [
297
302
--test-- "import needs file!"
298
303
;- at this moment files imported from other file
299
304
;- does not use parent file's location!
300
- import %units/files/test-needs-file.reb
305
+ m: import %units/files/test-needs-file.reb
301
306
--assert true? test-needs-file-result
307
+ --assert all [
308
+ ;@@ https://github.com/Oldes/Rebol-wishes/issues/13
309
+ object? m/local-lib
310
+ m/local-lib/test-needs-file-value = 42 ; value imported from the inner module
311
+ ]
312
+
302
313
--test-- "import needs url!"
303
314
--assert not error? try [
304
315
import https://github.com/Oldes/Rebol3/raw/master/src/tests/units/files/test-needs-url.reb
305
316
--assert true? test-needs-url-result
306
317
]
307
318
319
+ --test-- "local-lib"
320
+ ;@@ https://github.com/Oldes/Rebol-wishes/issues/13
321
+ --assert same? local-lib system/contexts/user
322
+
308
323
===end-group===
309
324
310
325
===start-group=== "module issues"
311
326
--test-- "issue-1005"
312
327
;@@ https://github.com/Oldes/Rebol-issues/issues/1005
313
328
m: module [] [a: 1 2 ]
314
- --assert [a: 1 ] = body-of m
315
- --assert [a] = keys-of m
316
- --assert [1 ] = values-of m
329
+ --assert [local-lib: #[object![]] a: 1 ] = body-of m
330
+ --assert [local-lib a] = keys-of m
331
+ --assert [#[object![]] 1 ] = values-of m
317
332
m: module [exports: [a]] [a: 1 2 ]
318
- --assert [a: 1 ] = body-of m
319
- --assert [a] = keys-of m
320
- --assert [1 ] = values-of m
333
+ --assert [local-lib: #[object![]] a: 1 ] = body-of m
334
+ --assert [local-lib a] = keys-of m
335
+ --assert [#[object![]] 1 ] = values-of m
321
336
322
337
--test-- "issue-1708"
323
338
;@@ https://github.com/Oldes/Rebol-issues/issues/1708
0 commit comments