From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- third_party/rust/matches/tests/macro_use_one.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 third_party/rust/matches/tests/macro_use_one.rs (limited to 'third_party/rust/matches/tests/macro_use_one.rs') diff --git a/third_party/rust/matches/tests/macro_use_one.rs b/third_party/rust/matches/tests/macro_use_one.rs new file mode 100644 index 0000000000..a527a89ce7 --- /dev/null +++ b/third_party/rust/matches/tests/macro_use_one.rs @@ -0,0 +1,11 @@ +// https://github.com/SimonSapin/rust-std-candidates/issues/12 +#[macro_use(matches)] extern crate matches; + +#[test] +fn matches_works() { + let foo = Some("-12"); + assert!(matches!(foo, Some(bar) if + matches!(bar.as_bytes()[0], b'+' | b'-') && + matches!(bar.as_bytes()[1], b'0'...b'9') + )); +} -- cgit v1.2.3