Files
breeze/tests/package_release_behavior.zi
T
waozi b868c162c9 Run only Habits and Practices packages that draw their own screens
This host no longer draws Habits' and Practices' screens, so a package of
theirs built for an older host interface would leave them blank. Each app
in apps/versions.json may now name the oldest host interface its packages
must be built for; Habits and Practices name 30. An older installed or
rolled-back package gives way to the bundled copy, and the compatibility
test skips the node's older releases of those two as this build does.
2026-10-25 00:25:23 -03:00

49 lines
1.8 KiB
Ziran

#import, file "../src/apps/package_release.zi";
c :: #system_library "c";
PackageFixture :: (name: string) -> string #foreign c;
#program_export
CheckPackageReleases :: () -> s32 {
public := PackageFixture("public")
names: [6]string = .["inbe", "lists", "habits", "practices", "diary", "lumi"]
for index: cast(s32)0..cast(s32)5 {
value := PackageParseRelease(PackageFixture(names[index]), index, public)
if !value.valid {
return index + 1
}
}
rejected: [10]string = .["wrong-app", "wrong-api", "bad-signature", "fraction",
"negative", "runtime", "bad-version", "extra-dependency", "old-api", "wrong-module"]
for index: cast(s32)0..cast(s32)9 {
if PackageParseRelease(PackageFixture(rejected[index]), 2, public).valid {
return index + 10
}
}
if !PackageParseRelease(PackageFixture("oldest-api"), 2, public).valid {
return 24
}
if !PackageParseRelease(PackageFixture("current-api"), 2, public).valid {
return 25
}
// Lists still runs packages built for the ledger's oldest interface.
if !PackageParseRelease(PackageFixture("lists-oldest-api"), 1, public).valid {
return 26
}
habits := PackageParseRelease(PackageFixture("habits"), 2, public)
if !PackageVerifyBytes(PackageFixture("habits-bytes"), habits) {
return 20
}
if PackageVerifyBytes(PackageFixture("corrupt-bytes"), habits) {
return 21
}
root := PackageParseRelease(PackageFixture("inbe"), 0, public)
if !PackageVerifyBytes(PackageFixture("root-bytes"), root) {
return 22
}
wrong := PackageParseRelease(PackageFixture("wrong-nested"), 0, public)
if !wrong.valid || PackageVerifyBytes(PackageFixture("root-bytes"), wrong) {
return 23
}
return 0
}