// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ // ┃ __ _ ____ ______ ┃ // ┃ ____ / /_ (_)______ __/ __ \/ ____/ ┃ // ┃ / __ \/ __ \/ / ___/ / / / /_/ / / ┃ // ┃ / /_/ / / / / (__ ) /_/ / _, _/ /___ ┃ // ┃ / .___/_/ /_/_/____/\__, /_/ |_|\____/ ┃ // ┃ /_/ /____/ ┃ // ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ // ┃ Copyright: (c) 2023, Mike 'PhiSyX' S. (https://github.com/PhiSyX) ┃ // ┃ SPDX-License-Identifier: MPL-2.0 ┃ // ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃ // ┃ ┃ // ┃ This Source Code Form is subject to the terms of the Mozilla Public ┃ // ┃ License, v. 2.0. If a copy of the MPL was not distributed with this ┃ // ┃ file, You can obtain one at https://mozilla.org/MPL/2.0/. ┃ // ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ use lexa_wildcard_matching::WildcardMatching; #[test] fn test_returning_result() { assert_eq!( "PhiSyX[bot]".wildcard_match("PhiSyX[???]"), Some("PhiSyX[bot]") ); assert_eq!( "PhiSyX[xxx]".wildcard_match("PhiSyX[*]"), Some("PhiSyX[xxx]") ); assert_eq!( "Hello World".wildcard_match("Hello*World"), Some("Hello World") ); assert_eq!("Hello World".wildcard_match("Hello?World"), None); }