Stabel

Check-in [7403f0755f]
Login
Overview
Comment:Integration test for fully qualified functions.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7403f0755fe6a6c5ca4af9a0051887f87dde615ac882962124df6fc504408a19
User & Date: robin.hansen on 2021-09-25 12:16:24
Other Links: manifest | tags
Context
2021-09-25
12:36
Error handling for fully qualified refs. This concludes the syntax changes language proposal. [c2996... Leaf check-in: 106eea3696 user: robin.hansen tags: trunk
12:16
Integration test for fully qualified functions. check-in: 7403f0755f user: robin.hansen tags: trunk
09:48
Happy path implementaton of fully qualified references. Still needs error handling and an integratio... check-in: d9f4e595b8 user: robin.hansen tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified wasm_tests/module_resolution.test.js from [b4cd6fda72] to [94472ceb85].

123
124
125
126
127
128
129










































130
131
132
133
134
135
136
        ]
    });

    const result = await compiler.run(wat, entryPoint);

    expect(result.stackElement()).toBe(2);
});











































test('External package types', async () => {
    const entryPoint = '/author/sample/core/main'
    const wat = await compiler.toProjectWat({
        entryPoint: entryPoint, 
        modules: [
            {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
        ]
    });

    const result = await compiler.run(wat, entryPoint);

    expect(result.stackElement()).toBe(2);
});

test('Fully qualified functions', async () => {
    const entryPoint = '/author/sample/core/main'
    const wat = await compiler.toProjectWat({
        entryPoint: entryPoint, 
        modules: [
            {
                package: 'external/sample',
                module: 'external',
                source: `
                    def: inc
                    : 1 +
                `
            },
            {
                package: 'internal/sample',
                module: 'external',
                source: `
                    defmulti: flip
                    type: Int -- Int
                    : 1
                      drop 0
                    else: drop 1
                `
            },
            {
                package: 'author/sample',
                module: 'core',
                source: `
                    def: main
                    : 1 
                      //internal/sample/external/flip
                      //external/sample/external/inc
                `
            },
        ]
    });

    const result = await compiler.run(wat, entryPoint);

    expect(result.stackElement()).toBe(1);
});

test('External package types', async () => {
    const entryPoint = '/author/sample/core/main'
    const wat = await compiler.toProjectWat({
        entryPoint: entryPoint, 
        modules: [
            {