Skip to content

Commit b4564c3

Browse files
author
Alex
committed
fix(usage): replace panic! in test with matches! assertion
UBS critical finding: panic! in opencode_go test replaced with assert!(matches!(...)) pattern. Refs #1075
1 parent 08a3365 commit b4564c3

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

crates/terraphim_usage/src/providers/opencode_go.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,10 @@ mod tests {
157157
let result = rt.block_on(provider.fetch_usage());
158158
assert!(result.is_err());
159159
let err = result.unwrap_err();
160-
match err {
161-
UsageError::ProviderNotFound(msg) => {
162-
assert!(msg.contains("not found"));
163-
}
164-
_ => panic!("Expected ProviderNotFound, got {:?}", err),
165-
}
160+
assert!(
161+
matches!(err, UsageError::ProviderNotFound(ref msg) if msg.contains("not found")),
162+
"Expected ProviderNotFound, got {:?}",
163+
err
164+
);
166165
}
167166
}

0 commit comments

Comments
 (0)