Express process end exceptions as hex in filters

This commit is contained in:
Félix Saparelli 2021-12-23 00:32:56 +13:00
parent 9d04143202
commit f19dbf945d
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
2 changed files with 3 additions and 3 deletions

View File

@ -390,7 +390,7 @@ impl TaggedFilterer {
|| filter.matches(format!("signal({})", int))?) || filter.matches(format!("signal({})", int))?)
} }
Some(ProcessEnd::ExitStop(int)) => filter.matches(format!("stop({})", int)), Some(ProcessEnd::ExitStop(int)) => filter.matches(format!("stop({})", int)),
Some(ProcessEnd::Exception(int)) => filter.matches(format!("exception({})", int)), Some(ProcessEnd::Exception(int)) => filter.matches(format!("exception({:X})", int)),
Some(ProcessEnd::Continued) => filter.matches("continued"), Some(ProcessEnd::Continued) => filter.matches("continued"),
}, },
(_, _) => { (_, _) => {

View File

@ -362,9 +362,9 @@ async fn complete_with_any_stop() {
#[tokio::test] #[tokio::test]
async fn complete_with_specific_exception() { async fn complete_with_specific_exception() {
let filterer = filt(&[filter("complete*=exception(19)")]).await; let filterer = filt(&[filter("complete*=exception(4B53)")]).await;
filterer.complete_does_pass(Some(ProcessEnd::Exception(NonZeroI32::new(19).unwrap()))); filterer.complete_does_pass(Some(ProcessEnd::Exception(NonZeroI32::new(19283).unwrap())));
filterer.complete_doesnt_pass(Some(ProcessEnd::Success)); filterer.complete_doesnt_pass(Some(ProcessEnd::Success));
filterer.complete_doesnt_pass(None); filterer.complete_doesnt_pass(None);
} }