aboutsummaryrefslogtreecommitdiff
path: root/b3sum/tests
AgeCommit message (Collapse)Author
2025-02-28combine test_check and test_check_tagJack O'Connor
2025-02-28add testsLeah Neukirchen
Adapted from https://github.com/BLAKE3-team/BLAKE3/pull/430/ by dbohdan.
2024-11-26another Windows-style newlines testJack O'Connor
2024-11-25add support for windows newlines in b3sum --checkJack O'Connor
Fixes #222.
2023-06-06add b3sum --seekJack O'Connor
2023-02-04suppress expected stderr prints in b3sum testsJack O'Connor
2023-02-04add a colon to the b3sum warning formatJack O'Connor
This matches what md5sum does.
2023-02-04Add --check summary of failuresjoveian
Add a warning to stderr at the end similar to other *sum utilities when --check is used and some files failed verification. At least the last part of the comment above check_one_checkfile seemed to be incorrect so I removed that comment. Fixes #283
2022-12-13test `b3sum --keyed` with bad key lengthsJack O'Connor
2021-02-28make derive_key() return an arrayJack O'Connor
2020-06-24put the file name in b3sum error outputJack O'Connor
This was previously there, but got dropped in c5c07bb337d0af7522666d05308aaf24eef3709c.
2020-05-23add a test commentJack O'Connor
2020-05-23use wild::args_os to support globbing on WindowsJack O'Connor
2020-05-23add support for --quiet to `b3sum --check`Jack O'Connor
Suggested by @llowrey: https://github.com/BLAKE3-team/BLAKE3/issues/33#issuecomment-629853747
2020-05-14print per-file errros more gracefuly in --checkJack O'Connor
2020-05-13refactor b3sum to support --checkJack O'Connor
This is an overall cleanup of everything that b3sum is doing, especially file opening and memory mapping, which makes it easier for the regular hashing mode to share code with the checking mode.
2020-05-13switch from assert_cmd to CARGO_BIN_EXE_*Jack O'Connor
2020-05-12add parse_check_lineJack O'Connor
As part of this, reorganize b3sum tests into src/unit_tests.rs and tests/cli_tests.rs.
2020-05-12stop printing the lossy warningJack O'Connor
Rather than breaking the check parse with more output, we'll have a rule that a Unicode replacement character (�) in a path name automatically fails the check.
2020-05-05add newline and backslash escaping to b3sum outputJack O'Connor
As proposed in https://github.com/BLAKE3-team/BLAKE3/issues/33#issuecomment-623153164 This brings b3sum behavior close to md5sum. All occurrences of backslash are replaced with "\\", and all occurrences of (Unix) newline are replaced with "\n". In addition, any line containing these escapes has a single "\" prepended to the front. Filepaths were already being converted to UTF-8 with to_string_lossy(), but this commit adds an extra warning when that conversion is in fact lossy (because the path is not valid Unicode). This new warning is printed to stdout, with the goal of deliberately breaking --check (which is not yet implemented) in this case.
2020-01-20b3sum: add no-mmap optionCesar Eduardo Barros
Using mmap is not always the best option. For instance, if the file is truncated while being read, b3sum will receive a SIGBUS and abort. Follow ripgrep's lead and add a --no-mmap option to disable mmap. This can also help benchmark the mmap versus the read path, and help debug performance issues potentially caused by mmap access patterns (like issue #32).
2020-01-13Making sure our raw multi-file test is testing what we think it isphayes
2020-01-13Using stdout_capture for capturing stdout that is not a stringphayes
2020-01-13Adds support for raw output to b3sumphayes
2020-01-05make the --length argument require a valueJack O'Connor
2019-12-28make derive_key take a key of any lengthJack O'Connor
The previous version of this API called for a key of exactly 256 bits. That's good for optimal performance, but it would mean losing the use-with-other-algorithms property for applications whose input keys are a different size. There's no way for an abstraction over the previous version to provide reliable domain separation for the "extract" step.
2019-12-13make b3sum --keyed and --derive-key read the key from stdinJack O'Connor
Putting secret keys on the command line is bad practice, because command line args are usually globally visible within the OS. Even if these flags are mostly intended for testing and experimentation, we might as well do the right thing. Plus this saves people the trouble of hex encoding their keys.
2019-12-12initial version of b3sumJack O'Connor