-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathredunit.red
More file actions
38 lines (31 loc) · 1.05 KB
/
redunit.red
File metadata and controls
38 lines (31 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Red [
Title: "RedUnit"
Description: "Tool for running tests of Red scripts like in xUnit, nUnit and other similar libs."
Purpose: "Be able to test Red language scripts"
Author: "Mateusz Palichleb"
File: %redunit.red
Version: "0.0.3"
]
redunit-modules-builder: context [
; build and merge all of the modules into one merged object!
build: does [
/local modules: context []
modules: add-object-from-file %modules/internal.red modules
modules: add-object-from-file %modules/assertions.red modules
modules: add-object-from-file %modules/general.red modules
return modules
]
/local add-object-from-file: func [
"Add object from file to modules"
filepath[file!]
modules[object!]
] [
/local loaded: do filepath
unless object? loaded [
print rejoin ["[Error] Loaded file '" (to string! filepath) "' does not contain an object!"]
halt
]
return make modules loaded
]
]
redunit: redunit-modules-builder/build