forked from goto-bus-stop/setup-zig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
36 lines (33 loc) · 1.22 KB
/
test.js
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
const assert = require('assert').strict
const {
resolveCommit,
resolveVersion
} = require('./versions')
async function test () {
assert.deepEqual(resolveCommit('linux', '0.6.0+4b48fccad'), {
downloadUrl: 'https://ziglang.org/builds/zig-linux-x86_64-0.6.0+4b48fccad.tar.xz',
variantName: 'zig-linux-x86_64-0.6.0+4b48fccad',
version: '0.6.0+4b48fccad'
})
assert.deepEqual(resolveCommit('win32', '0.6.0+4b48fccad'), {
downloadUrl: 'https://ziglang.org/builds/zig-windows-x86_64-0.6.0+4b48fccad.zip',
variantName: 'zig-windows-x86_64-0.6.0+4b48fccad',
version: '0.6.0+4b48fccad'
})
assert.deepEqual(await resolveVersion('linux', '0.7.0'), {
downloadUrl: 'https://ziglang.org/download/0.7.0/zig-linux-x86_64-0.7.0.tar.xz',
variantName: 'zig-linux-x86_64-0.7.0',
version: '0.7.0'
})
assert.deepEqual(await resolveVersion('win32', '0.4.0'), {
downloadUrl: 'https://ziglang.org/download/0.4.0/zig-windows-x86_64-0.4.0.zip',
variantName: 'zig-windows-x86_64-0.4.0',
version: '0.4.0'
})
await assert.doesNotReject(resolveVersion('linux', 'master'))
await assert.doesNotReject(resolveVersion('win32', 'master'))
}
test().catch((error) => {
console.error(error.stack)
process.exit(1)
})