-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from con/gh-68b
Cache directory fingerprint as a XORed hash of file fingerprints
- Loading branch information
Showing
3 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import pytest | ||
from ..cache import xor_bytes | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"b1,b2,r", | ||
[ | ||
(b"\x12", b"\x34", b"\x26"), | ||
(b"\0\x12", b"\0\x34", b"\0\x26"), | ||
(b"\x12\0", b"\x34\0", b"\x26\0"), | ||
(b"\x12\xAB", b"\x34", b"\x26\xAB"), | ||
(b"\x12\xAB", b"\x34\xCD", b"\x26\x66"), | ||
], | ||
) | ||
def test_xor_bytes(b1: bytes, b2: bytes, r: bytes) -> None: | ||
assert xor_bytes(b1, b2) == r |