源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
This commit is contained in:
commit
2ed3415fb7
8018 files changed
+1936476
No files matched your search
@@ -0,0 +1,70 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import {
|
||||
updaterTargetMeetsMinimum,
|
||||
validateMinimumVersionResponse
|
||||
} from "./minimumVersion.ts";
|
||||
|
||||
test("compares updater targets without numeric precision loss", () => {
|
||||
assert.equal(updaterTargetMeetsMinimum("1.6.0", "1.6.0"), true);
|
||||
assert.equal(updaterTargetMeetsMinimum("1.7.0", "1.7.0-rc.2"), true);
|
||||
assert.equal(updaterTargetMeetsMinimum("1.7.0-rc.1", "1.7.0-rc.2"), false);
|
||||
assert.equal(updaterTargetMeetsMinimum("1.7.0-beta.1", "1.7.0"), false);
|
||||
assert.deepEqual(
|
||||
updaterTargetMeetsMinimum(
|
||||
"900719925474099312345.0.0",
|
||||
"900719925474099312344.999.999"
|
||||
),
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
test("combines a validated policy response with the local request identity", () => {
|
||||
const request = {
|
||||
architecture: "arm64",
|
||||
currentVersion: "1.6.0",
|
||||
platform: "macos",
|
||||
product: "tsh-desktop"
|
||||
} as const;
|
||||
assert.deepEqual(
|
||||
validateMinimumVersionResponse(
|
||||
{
|
||||
channel: "stable",
|
||||
decision: "upgradeRequired",
|
||||
minimumVersion: "1.6.1",
|
||||
policyRevision: "revision-1",
|
||||
reason: "belowMinimum"
|
||||
},
|
||||
request
|
||||
),
|
||||
{
|
||||
...request,
|
||||
channel: "stable",
|
||||
decision: "upgradeRequired",
|
||||
minimumVersion: "1.6.1",
|
||||
policyRevision: "revision-1",
|
||||
reason: "belowMinimum"
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
test("accepts an explicitly unconfigured minimum version", () => {
|
||||
const request = {
|
||||
architecture: "arm64",
|
||||
currentVersion: "1.6.0",
|
||||
platform: "macos",
|
||||
product: "tsh-desktop"
|
||||
} as const;
|
||||
const response = validateMinimumVersionResponse(
|
||||
{
|
||||
channel: "stable",
|
||||
decision: "allowed",
|
||||
policyRevision: "revision-1",
|
||||
reason: "minimumNotConfigured"
|
||||
},
|
||||
request
|
||||
);
|
||||
|
||||
assert.equal(response.reason, "minimumNotConfigured");
|
||||
assert.equal("minimumVersion" in response, false);
|
||||
});
|
||||
Reference in new issue
Block a user