mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
support raw strings in match patterns (#14573)
Fixes #14554 # User-Facing Changes Raw strings are now supported in match patterns: ```diff match "foo" { r#'foo'# => true, _ => false } -false +true ```
This commit is contained in:
@ -140,6 +140,15 @@ fn match_constant_7() {
|
||||
assert_eq!(actual.out, "success");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_constant_8() {
|
||||
let actual =
|
||||
nu!(r#"match "foo" { r#'foo'# => { print "success" }, _ => { print "failure" } }"#);
|
||||
// Make sure we don't see any of these values in the output
|
||||
// As we do not auto-print loops anymore
|
||||
assert_eq!(actual.out, "success");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn match_null() {
|
||||
let actual = nu!(r#"match null { null => { print "success"}, _ => { print "failure" }}"#);
|
||||
|
Reference in New Issue
Block a user