Skip to content

Commit a106038

Browse files
committed
1 parent fd1dc60 commit a106038

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

src/tests/units/module-test.r3

+25-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Rebol [
33
Author: "Peter W A Wood, Oldes"
44
File: %module-test.r3
55
Tabs: 4
6-
Needs: %../quick-test-module.r3
6+
Needs: quick-test
77
]
88

99
~~~start-file~~~ "module!"
@@ -17,11 +17,11 @@ supplement system/options/module-paths join what-dir %units/files/
1717
--test-- "hidden"
1818
;@@ https://github.com/Oldes/Rebol-issues/issues/1696
1919
--assert all [
20-
[a] = words-of m: module [] [a: 1]
20+
[local-lib a] = words-of m: module [] [a: 1]
2121
m/a = 1
2222
]
2323
--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]]
2525
error? try [m/a]
2626
m/b = 2
2727
]
@@ -263,6 +263,11 @@ probe all [
263263
e/id = 'needs
264264
]
265265
--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+
]
266271

267272
--test-- "import/check"
268273
;@@ https://github.com/Oldes/Rebol-issues/issues/1686
@@ -297,27 +302,37 @@ probe all [
297302
--test-- "import needs file!"
298303
;- at this moment files imported from other file
299304
;- does not use parent file's location!
300-
import %units/files/test-needs-file.reb
305+
m: import %units/files/test-needs-file.reb
301306
--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+
302313
--test-- "import needs url!"
303314
--assert not error? try [
304315
import https://github.com/Oldes/Rebol3/raw/master/src/tests/units/files/test-needs-url.reb
305316
--assert true? test-needs-url-result
306317
]
307318

319+
--test-- "local-lib"
320+
;@@ https://github.com/Oldes/Rebol-wishes/issues/13
321+
--assert same? local-lib system/contexts/user
322+
308323
===end-group===
309324

310325
===start-group=== "module issues"
311326
--test-- "issue-1005"
312327
;@@ https://github.com/Oldes/Rebol-issues/issues/1005
313328
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
317332
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
321336

322337
--test-- "issue-1708"
323338
;@@ https://github.com/Oldes/Rebol-issues/issues/1708

0 commit comments

Comments
 (0)