Debian Codegraph @

debian/missing-sources/matches/tests/macro_use_one.rs

raw
1 // https://github.com/SimonSapin/rust-std-candidates/issues/12
2 #[macro_use(matches)] extern crate matches;
3
4 #[test]
5 fn matches_works() {
6 let foo = Some("-12");
7 assert!(matches!(foo, Some(bar) if
8 matches!(bar.as_bytes()[0], b'+' | b'-') &&
9 matches!(bar.as_bytes()[1], b'0'...b'9')
10 ));
11 }