aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/tests')
-rw-r--r--crates/shirabe/tests/all_functional_test.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/shirabe/tests/all_functional_test.rs b/crates/shirabe/tests/all_functional_test.rs
index 500f822e..8578ed43 100644
--- a/crates/shirabe/tests/all_functional_test.rs
+++ b/crates/shirabe/tests/all_functional_test.rs
@@ -8,7 +8,7 @@
use indexmap::IndexMap;
use serial_test::serial;
use shirabe::util::filesystem::Filesystem;
-use shirabe_pcre::preg::{Preg, PregMatchedGroups};
+use shirabe_pcre::preg::Preg;
use shirabe_php_shim::{CaptureKey, PhpMixed, intval, php_regex, preg_split_delim_capture};
use std::path::{Path, PathBuf};
@@ -141,15 +141,13 @@ fn expect_matches(expected: &str, output: &str) {
line += 1;
}
if eb[i] == b'%' {
- let mut m = PregMatchedGroups::new();
- if !Preg::is_match3(php_regex!("{%(.+?)%}"), &expected[i..], Some(&mut m)) {
+ let Some(m) = Preg::is_match3(php_regex!("{%(.+?)%}"), &expected[i..]) else {
panic!("Failed to match %...% in {}", &expected[i..]);
- }
+ };
let regex = m.get(&CaptureKey::ByIndex(1)).cloned().unwrap();
let pattern = format!("{{{}}}", regex);
- let mut m = PregMatchedGroups::new();
- if Preg::is_match3(&pattern, &output[j..], Some(&mut m)) {
+ if let Some(m) = Preg::is_match3(&pattern, &output[j..]) {
let full = m.get(&CaptureKey::ByIndex(0)).cloned().unwrap();
i += regex.len() + 2;
j += full.len();