Implement is [not] distinct from (#361)

* Implement is [not] distinct from

* Simplify message

* Clippy
This commit is contained in:
Daniël Heres 2021-10-14 18:26:28 +02:00 committed by GitHub
parent c9f8a44b55
commit 0f0b327e97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 7 deletions

View file

@ -586,6 +586,31 @@ fn parse_is_not_null() {
);
}
#[test]
fn parse_is_distinct_from() {
use self::Expr::*;
let sql = "a IS DISTINCT FROM b";
assert_eq!(
IsDistinctFrom(
Box::new(Identifier(Ident::new("a"))),
Box::new(Identifier(Ident::new("b")))
),
verified_expr(sql)
);
}
#[test]
fn parse_is_not_distinct_from() {
use self::Expr::*;
let sql = "a IS NOT DISTINCT FROM b";
assert_eq!(
IsNotDistinctFrom(
Box::new(Identifier(Ident::new("a"))),
Box::new(Identifier(Ident::new("b")))
),
verified_expr(sql)
);
}
#[test]
fn parse_not_precedence() {
// NOT has higher precedence than OR/AND, so the following must parse as (NOT true) OR true