From c921de45d42c1b12e3ffdf38b1ac6f00a882eb82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Fri, 26 Apr 2024 09:51:59 +0200 Subject: [PATCH] Update tests for version resolution --- test.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test.js b/test.js index 0933011..308a035 100644 --- a/test.js +++ b/test.js @@ -5,29 +5,35 @@ const { } = require('./versions') async function test () { - assert.deepEqual(resolveCommit('linux', '0.6.0+4b48fccad'), { + assert.deepEqual(resolveCommit('x64', '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'), { + assert.deepEqual(resolveCommit('x64', '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'), { + assert.deepEqual(await resolveVersion('x64', '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'), { + assert.deepEqual(await resolveVersion('x64', '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')) + assert.deepEqual(await resolveVersion('arm64', 'darwin', '0.11.0'), { + downloadUrl: 'https://ziglang.org/download/0.11.0/zig-macos-aarch64-0.11.0.tar.xz', + variantName: 'zig-macos-aarch64-0.11.0', + version: '0.11.0' + }) + await assert.doesNotReject(resolveVersion('x64', 'linux', 'master')) + await assert.doesNotReject(resolveVersion('x64', 'win32', 'master')) + await assert.doesNotReject(resolveVersion('arm64', 'darwin', 'master')) } test().catch((error) => {