GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — t3code/scripts/merge-mac-update-manifests.test.ts at main · cavidan133/t3code

Expand file tree

/

merge-mac-update-manifests.test.ts

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
108 lines (97 loc) · 2.64 KB
/

merge-mac-update-manifests.test.ts

Copy path

File metadata and controls

108 lines (97 loc) · 2.64 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import { assert, describe, it } from "@effect/vitest";
import {
mergeMacUpdateManifests,
parseMacUpdateManifest,
serializeMacUpdateManifest,
} from "./merge-mac-update-manifests.ts";
describe("merge-mac-update-manifests", () => {
it("merges arm64 and x64 macOS update manifests into one multi-arch manifest", () => {
const arm64 = parseMacUpdateManifest(
`version: 0.0.4
files:
- url: T3-Code-0.0.4-arm64.zip
sha512: arm64zip
size: 125621344
- url: T3-Code-0.0.4-arm64.dmg
sha512: arm64dmg
size: 131754935
path: T3-Code-0.0.4-arm64.zip
sha512: arm64zip
releaseDate: '2026-03-07T10:32:14.587Z'
`,
"latest-mac.yml",
);
const x64 = parseMacUpdateManifest(
`version: 0.0.4
files:
- url: T3-Code-0.0.4-x64.zip
sha512: x64zip
size: 132000112
- url: T3-Code-0.0.4-x64.dmg
sha512: x64dmg
size: 138148807
path: T3-Code-0.0.4-x64.zip
sha512: x64zip
releaseDate: '2026-03-07T10:36:07.540Z'
`,
"latest-mac-x64.yml",
);
const merged = mergeMacUpdateManifests(arm64, x64);
assert.equal(merged.version, "0.0.4");
assert.equal(merged.releaseDate, "2026-03-07T10:36:07.540Z");
assert.deepStrictEqual(
merged.files.map((file) => file.url),
[
"T3-Code-0.0.4-arm64.zip",
"T3-Code-0.0.4-arm64.dmg",
"T3-Code-0.0.4-x64.zip",
"T3-Code-0.0.4-x64.dmg",
],
);
const serialized = serializeMacUpdateManifest(merged);
assert.ok(!serialized.includes("path:"));
assert.equal((serialized.match(/- url:/g) ?? []).length, 4);
});
it("rejects mismatched manifest versions", () => {
const arm64 = parseMacUpdateManifest(
`version: 0.0.4
files:
- url: T3-Code-0.0.4-arm64.zip
sha512: arm64zip
size: 1
releaseDate: '2026-03-07T10:32:14.587Z'
`,
"latest-mac.yml",
);
const x64 = parseMacUpdateManifest(
`version: 0.0.5
files:
- url: T3-Code-0.0.5-x64.zip
sha512: x64zip
size: 1
releaseDate: '2026-03-07T10:36:07.540Z'
`,
"latest-mac-x64.yml",
);
assert.throws(() => mergeMacUpdateManifests(arm64, x64), /different versions/);
});
it("preserves quoted scalars as strings", () => {
const manifest = parseMacUpdateManifest(
`version: '1.0'
files:
- url: T3-Code-1.0-x64.zip
sha512: zipsha
size: 1
releaseName: 'true'
minimumSystemVersion: '13.0'
stagingPercentage: 50
releaseDate: '2026-03-07T10:36:07.540Z'
`,
"latest-mac.yml",
);
assert.equal(manifest.version, "1.0");
assert.equal(manifest.extras.releaseName, "true");
assert.equal(manifest.extras.minimumSystemVersion, "13.0");
assert.equal(manifest.extras.stagingPercentage, 50);
});
});
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.