MCPcopy Create free account
hub / github.com/CodeSentryAI/lockbud / test_panic_api_regex

Function test_panic_api_regex

src/detector/panic/mod.rs:57–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55 use super::*;
56 #[test]
57 fn test_panic_api_regex() {
58 assert!(PANIC_API_REGEX[&PanicAPI::ResultUnwrap].is_match("Result::<i32, String>::unwrap"));
59 assert!(PANIC_API_REGEX[&PanicAPI::ResultExpect].is_match("Result::<i32, String>::expect"));
60 assert!(PANIC_API_REGEX[&PanicAPI::OptionUnwrap].is_match("Option::<i32>::unwrap"));
61 assert!(PANIC_API_REGEX[&PanicAPI::OptionExpect].is_match("Option::<i32>::expect"));
62 assert!(PANIC_API_REGEX[&PanicAPI::PanicFmt].is_match("rt::panic_fmt"));
63 assert!(PANIC_API_REGEX[&PanicAPI::AssertFailed].is_match("core::panicking::assert_failed"));
64 assert!(PANIC_API_REGEX[&PanicAPI::Panic].is_match("core::panicking::panic"));
65 assert!(!PANIC_API_REGEX[&PanicAPI::Panic].is_match("no_panic"));
66 }
67}
68
69#[derive(Debug, Clone, PartialEq, Eq, Hash)]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected