Inert step tolerates only 'not registered'; guard fails on query or plist errors; test asserts the tile rejection (R2.15)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 01:31:08 -04:00
1 parent 1745ee237d
commit b5d490c49a
3 files changed
+15 -4

No files matched your search

+8 -2
View File
@@ -290,8 +290,14 @@ fn an_unpatched_build_is_rejected() {
return;
}
let dir = tempfile::tempdir().expect("a temp dir");
let outcome = Worker::spawn(&frameworks, &dir.path().join("profile"));
assert!(outcome.is_err(), "the unpatched build must be rejected");
let Err(error) = Worker::spawn(&frameworks, &dir.path().join("profile")) else {
panic!("the unpatched build must be rejected");
};
assert_eq!(error.kind(), std::io::ErrorKind::InvalidData, "{error}");
assert!(
error.to_string().contains("does not paint tiles (unpatched)"),
"rejected for the tile check, not {error}"
);
}
#[test]
+4 -1
View File
@@ -11,7 +11,10 @@ for key in CFBundleDocumentTypes CFBundleURLTypes UTExportedTypeDeclarations UTI
fi
done
rm -rf "$app/Contents/PlugIns" "$app/Contents/Library/Spotlight"
"$lsregister" -u "$app"
# -10814: not registered, which is the goal.
if ! said=$("$lsregister" -u "$app" 2>&1); then
grep -q -- "-10814" <<<"$said" || { echo "inert-lo.sh: $said" >&2; exit 1; }
fi
# Spotlight would find the bundle and register it again.
touch "$(cd "$app/../../.." && pwd)/.metadata_never_index"
echo "inert-lo.sh: $app claims no files and is unregistered"
+3 -1
View File
@@ -6,6 +6,7 @@ root=$(cd "$(dirname "$0")/../.." && pwd)
fail() { echo "FAIL: $*" >&2; exit 1; }
app=$root/engines/lo-src/instdir/LibreOffice.app
if [ -d "$app" ]; then
plutil -lint -s "$app/Contents/Info.plist" || fail "$app has no readable Info.plist"
for key in CFBundleDocumentTypes CFBundleURLTypes UTExportedTypeDeclarations UTImportedTypeDeclarations; do
! /usr/libexec/PlistBuddy -c "Print :$key" "$app/Contents/Info.plist" >/dev/null 2>&1 || fail "$app claims $key"
done
@@ -20,6 +21,7 @@ for path in CommandLine.arguments.dropFirst() {
for app in NSWorkspace.shared.urlsForApplications(toOpen: URL(fileURLWithPath: path)) { print(app.path) }
}
SWIFT
found=$(swift "$work/open.swift" "$work"/sample.* | grep -i libreoffice || true)
apps=$(swift "$work/open.swift" "$work"/sample.*) || fail "the Open With query failed"
found=$(grep -i libreoffice <<<"$apps" || true)
[ -z "$found" ] || fail "Open With lists LibreOffice: $found"
echo "ok: no LibreOffice in Open With"