summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/04_modules/15_complex_imports
blob: f4dd58837d63d70263302bddfc186d174285be00 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
This testcase implements a somewhat complex dependency chain to stress
test the compiler module resolving.

The dependency tree is:

root
 + mod1
    + mod4
    + mod8
 + mod2
    + mod4
    + mod6
    + mod8
    + mod9
 + mod3
    + mod4
    + mod6
 + mod4
 + mod5
    + mod1
       + mod4
       + mod8
    + mod2
       + mod4
       + mod6
       + mod8
       + mod9
    + mod4
    + mod6
    + mod8
    + mod9
       + mod4
       + mod6
 + mod6
 + mod7
    + mod5
       + mod1
          + mod4
          + mod8
       + mod2
          + mod4
          + mod6
          + mod8
          + mod9
       + mod4
       + mod6
       + mod8
       + mod9
          + mod4
          + mod6
    + mod6
 + mod8

-- Testcase --
import mod1 from 'mod1';
import mod2 from 'mod2';
import mod3 from 'mod3';
import mod4 from 'mod4';
import mod5 from 'mod5';
import mod6 from 'mod6';
import mod7 from 'mod7';
import mod8 from 'mod8';

print("root: ", [ mod1, mod2, mod3, mod4, mod5, mod6, mod7, mod8 ], "\n");
-- End --

-- File mod1.uc --
import mod4 from 'mod4';
import mod8 from 'mod8';

print("mod1: ", [ mod4, mod8 ], "\n");

export default 'mod1';
-- End --

-- File mod2.uc --
import mod9 from 'mod9';
import mod4 from 'mod4';
import mod8 from 'mod8';
import mod6 from 'mod6';

print("mod2: ", [ mod4, mod6, mod8, mod9 ], "\n");

export default 'mod2';
-- End --

-- File mod3.uc --
import mod4 from 'mod4';
import mod6 from 'mod6';

print("mod3: ", [ mod4, mod6 ], "\n");

export default 'mod3';
-- End --

-- File mod4.uc --
export default 'mod4';
-- End --

-- File mod5.uc --
import mod1 from 'mod1';
import mod4 from 'mod4';
import mod2 from 'mod2';
import mod9 from 'mod9';
import mod8 from 'mod8';
import mod6 from 'mod6';

print("mod5: ", [ mod1, mod2, mod4, mod6, mod8, mod9 ], "\n");

export default 'mod5';
-- End --

-- File mod6.uc --
export default 'mod6';
-- End --

-- File mod7.uc --
import mod6 from 'mod6';
import mod5 from 'mod5';

print("mod7: ", [ mod5, mod6 ], "\n");

export default 'mod7';
-- End --

-- File mod8.uc --
export default 'mod8';
-- End --

-- File mod9.uc --
import mod4 from 'mod4';
import mod6 from 'mod6';

print("mod9: ", [ mod4, mod6 ], "\n");

export default 'mod9';
-- End --

-- Args --
-R -L files/
-- End --

-- Expect stdout --
mod1: [ "mod4", "mod8" ]
mod9: [ "mod4", "mod6" ]
mod2: [ "mod4", "mod6", "mod8", "mod9" ]
mod3: [ "mod4", "mod6" ]
mod5: [ "mod1", "mod2", "mod4", "mod6", "mod8", "mod9" ]
mod7: [ "mod5", "mod6" ]
root: [ "mod1", "mod2", "mod3", "mod4", "mod5", "mod6", "mod7", "mod8" ]
-- End --