test(cli): a broad guard that a refusal writes nothing
Every test's books, when dropped, hold no failed call unless the test injected the fault on purpose (common::expect_failed_calls): a tool that writes a line and then refuses now fails every test that makes it refuse. hostile_args gains a guard that drives refused calls over every tool, and the same arguments with a made-up full tax id in each string in turn, and asserts the journal is byte for byte what it was after each refusal, with no trace of the tax id. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
a0fee420cd
commit
3f2ab70219
3 files changed
+202
No files matched your search
@@ -302,6 +302,8 @@ fn types(books: &Books) -> Vec<String> {
|
||||
/// corrupt page would.
|
||||
#[test]
|
||||
fn a_call_that_wrote_lines_and_then_failed_leaves_the_books_and_its_key_as_they_were() {
|
||||
// The fault is put there on purpose: this call fails part way.
|
||||
common::expect_failed_calls();
|
||||
let books = Books::new("calls-failed-lines");
|
||||
let mut w = books.session("test");
|
||||
let before = types(&books);
|
||||
@@ -675,6 +677,8 @@ fn set_tin(key: &str, tin: &str) -> Value {
|
||||
/// neither, and once the call can run again it is the new one that is kept.
|
||||
#[test]
|
||||
fn a_set_tin_that_fails_leaves_the_vault_as_it_was() {
|
||||
// The fault is put there on purpose: this call fails part way.
|
||||
common::expect_failed_calls();
|
||||
let books = Books::new("calls-vault-fail");
|
||||
let mut w = books.session("test");
|
||||
let party = answer_of(&w.call(
|
||||
|
||||
Reference in new issue
Block a user