Skip to content

Commit

Permalink
feat: make a minimum match of 1 for counting (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Aug 10, 2024
1 parent c5c8330 commit 3a7a052
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/auth/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{info::AuthInfo, testing::get_testing_auth_info};
pub static ENV_VAR_GRIT_LOCAL_SERVER: &str = "GRIT_LOCAL_SERVER";
pub static ENV_VAR_GRIT_AUTH_TOKEN: &str = "GRIT_AUTH_TOKEN";
pub static ENV_VAR_GRIT_API_URL: &str = "GRIT_API_URL";
pub static DEFAULT_GRIT_API_URL: &str = "https://api-gateway-prod-6et7uue.uc.gateway.dev";
pub static DEFAULT_GRIT_API_URL: &str = "https://api2.grit.io";
pub static ENV_VAR_GRAPHQL_API_URL: &str = "GRAPHQL_API_URL";
pub static DEFAULT_GRAPHQL_API_URL: &str = "https://grit-prod-central.hasura.app/v1";
pub static ENV_VAR_GRIT_APP_URL: &str = "GRIT_APP_URL";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ expression: "String::from_utf8(output.stdout)?"
}


Processed 1 files and found 0 matches
Processed 1 files and found 1 matches
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ Log in PlaygroundPattern: Warning: sequential matches at the top of the file. If
module "test_module3" {
Processed 4 files and found 0 matches
Processed 4 files and found 4 matches
5 changes: 2 additions & 3 deletions crates/marzano_messenger/src/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,8 @@ pub trait Messager: Send + Sync {
) -> anyhow::Result<bool> {
for r in execution_result {
if is_match(&r) {
if let Some(ranges) = r.get_ranges() {
details.matched += ranges.len() as i32;
}
let count = r.get_ranges().map(|ranges| ranges.len()).unwrap_or(0);
details.matched += count.max(1) as i32;
}
if let MatchResult::Rewrite(_) = r {
details.rewritten += 1;
Expand Down

0 comments on commit 3a7a052

Please sign in to comment.