use regex_generator::core::services::regex_verificator::RegexVerificator; #[test] fn match_regex_should_correct_with_valid_regex() { // given let regex = "[a-z]{4}"; let word = "test"; let expected = true; // when let result = RegexVerificator::r#match(regex, word); // then assert_eq!(result, expected); } #[test] fn match_regex_should_wrong_with_invalid_regex() { // given let regex = "[a-z]{2}"; let word = "1234"; let expected = false; // when let result = RegexVerificator::r#match(regex, word); // then assert_eq!(result, expected); } #[test] fn match_regex_should_wrong_with_invalid_format_regex() { // given let regex = "["; let word = "1234"; let expected = false; // when let result = RegexVerificator::r#match(regex, word); // then assert_eq!(result, expected); }