mirror of
https://github.com/nushell/nushell.git
synced 2024-11-08 01:24:38 +01:00
Rename =^ to 'starts-with' (#5407)
This commit is contained in:
parent
1f7d3498cd
commit
4a69819f9a
@ -4040,7 +4040,6 @@ pub fn parse_operator(
|
|||||||
b">" => Operator::GreaterThan,
|
b">" => Operator::GreaterThan,
|
||||||
b">=" => Operator::GreaterThanOrEqual,
|
b">=" => Operator::GreaterThanOrEqual,
|
||||||
b"=~" => Operator::RegexMatch,
|
b"=~" => Operator::RegexMatch,
|
||||||
b"=^" => Operator::StartsWith,
|
|
||||||
b"!~" => Operator::NotRegexMatch,
|
b"!~" => Operator::NotRegexMatch,
|
||||||
b"+" => Operator::Plus,
|
b"+" => Operator::Plus,
|
||||||
b"-" => Operator::Minus,
|
b"-" => Operator::Minus,
|
||||||
@ -4049,6 +4048,7 @@ pub fn parse_operator(
|
|||||||
b"in" => Operator::In,
|
b"in" => Operator::In,
|
||||||
b"not-in" => Operator::NotIn,
|
b"not-in" => Operator::NotIn,
|
||||||
b"mod" => Operator::Modulo,
|
b"mod" => Operator::Modulo,
|
||||||
|
b"starts-with" => Operator::StartsWith,
|
||||||
b"&&" | b"and" => Operator::And,
|
b"&&" | b"and" => Operator::And,
|
||||||
b"||" | b"or" => Operator::Or,
|
b"||" | b"or" => Operator::Or,
|
||||||
b"**" => Operator::Pow,
|
b"**" => Operator::Pow,
|
||||||
|
@ -47,7 +47,7 @@ impl Display for Operator {
|
|||||||
Operator::Pow => write!(f, "**"),
|
Operator::Pow => write!(f, "**"),
|
||||||
Operator::LessThanOrEqual => write!(f, "<="),
|
Operator::LessThanOrEqual => write!(f, "<="),
|
||||||
Operator::GreaterThanOrEqual => write!(f, ">="),
|
Operator::GreaterThanOrEqual => write!(f, ">="),
|
||||||
Operator::StartsWith => write!(f, "=^"),
|
Operator::StartsWith => write!(f, "starts-with"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ fn capture_row_condition() -> TestResult {
|
|||||||
#[test]
|
#[test]
|
||||||
fn starts_with_operator_succeeds() -> TestResult {
|
fn starts_with_operator_succeeds() -> TestResult {
|
||||||
run_test(
|
run_test(
|
||||||
r#"[Moe Larry Curly] | where $it =^ L | str collect"#,
|
r#"[Moe Larry Curly] | where $it starts-with L | str collect"#,
|
||||||
"Larry",
|
"Larry",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user