Rename =^ to 'starts-with' (#5407)

This commit is contained in:
JT 2022-05-02 19:20:07 +12:00 committed by GitHub
parent 1f7d3498cd
commit 4a69819f9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -4040,7 +4040,6 @@ pub fn parse_operator(
b">" => Operator::GreaterThan,
b">=" => Operator::GreaterThanOrEqual,
b"=~" => Operator::RegexMatch,
b"=^" => Operator::StartsWith,
b"!~" => Operator::NotRegexMatch,
b"+" => Operator::Plus,
b"-" => Operator::Minus,
@ -4049,6 +4048,7 @@ pub fn parse_operator(
b"in" => Operator::In,
b"not-in" => Operator::NotIn,
b"mod" => Operator::Modulo,
b"starts-with" => Operator::StartsWith,
b"&&" | b"and" => Operator::And,
b"||" | b"or" => Operator::Or,
b"**" => Operator::Pow,

View File

@ -47,7 +47,7 @@ impl Display for Operator {
Operator::Pow => write!(f, "**"),
Operator::LessThanOrEqual => write!(f, "<="),
Operator::GreaterThanOrEqual => write!(f, ">="),
Operator::StartsWith => write!(f, "=^"),
Operator::StartsWith => write!(f, "starts-with"),
}
}
}

View File

@ -321,7 +321,7 @@ fn capture_row_condition() -> TestResult {
#[test]
fn starts_with_operator_succeeds() -> TestResult {
run_test(
r#"[Moe Larry Curly] | where $it =^ L | str collect"#,
r#"[Moe Larry Curly] | where $it starts-with L | str collect"#,
"Larry",
)
}