Support pattern matching null literals (#10829)

# Description
Support pattern matching against the `null` literal.  Fixes #10799 

### Before
```nushell
> match null { null => "success", _ => "failure" }
failure
```

### After
```nushell
> match null { null => "success", _ => "failure" }
success
```

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->
Users can pattern match against a `null` literal.
This commit is contained in:
Hudson Clark
2023-10-24 18:30:45 -04:00
committed by GitHub
parent cb754befe9
commit 78b4472b32
2 changed files with 9 additions and 0 deletions

View File

@ -132,6 +132,12 @@ fn match_constant_7() {
assert_eq!(actual.out, "success");
}
#[test]
fn match_null() {
let actual = nu!(r#"match null { null => { print "success"}, _ => { print "failure" }}"#);
assert_eq!(actual.out, "success");
}
#[test]
fn match_or_pattern() {
let actual = nu!(