@@ -45,7 +45,23 @@ describe("inventory comparison", () => {
|
||||
changed: "changed",
|
||||
left: "only-left",
|
||||
right: "only-right",
|
||||
same: "same",
|
||||
same: "unverified",
|
||||
});
|
||||
});
|
||||
|
||||
it("only calls file contents equal after matching SHA-256 evidence", () => {
|
||||
const left = document([entry("same-size", 4, "declared")]);
|
||||
const right = document([entry("same-size", 4, "declared")]);
|
||||
expect(compareInventories(left, right)[0]?.status).toBe("unverified");
|
||||
expect(
|
||||
compareInventories(left, right, {
|
||||
"same-size": { leftSha256: "abc", rightSha256: "abc" },
|
||||
})[0]?.status,
|
||||
).toBe("same");
|
||||
expect(
|
||||
compareInventories(left, right, {
|
||||
"same-size": { leftSha256: "abc", rightSha256: "def" },
|
||||
})[0]?.status,
|
||||
).toBe("changed");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user