From 790df4165381ae3d83ec47a2d5d9ed35527e261d Mon Sep 17 00:00:00 2001 From: YoEight Date: Sun, 4 Jan 2026 14:02:54 -0500 Subject: [PATCH] chore: update test snapshots --- src/tests/lexer.rs | 4 +- src/tests/parser.rs | 22 +- ..._parser__tests__lexer__lexer_all_kind.snap | 73 +++-- ...__tests__lexer__lexer_negative_number.snap | 25 +- ...arser__tests__parser__parse_binary_op.snap | 307 +++++++++--------- ...parser__parse_from_events_nested_data.snap | 171 +++++----- ...ser__parse_from_events_using_subquery.snap | 271 ++++++++-------- ...ere_subject_project_record_with_count.snap | 121 +++---- ...m_events_with_top_identity_projection.snap | 81 ++--- ...om_events_with_type_to_project_record.snap | 163 +++++----- ...ser__parser_from_events_with_distinct.snap | 171 +++++----- ..._from_events_with_group_by_and_having.snap | 155 ++++----- ...sts__parser__parser_unhinged_unary_op.snap | 125 +++---- ..._tests__parser__parser_valid_contains.snap | 159 ++++----- ..._parser__parser_valid_type_conversion.snap | 125 +++---- 15 files changed, 993 insertions(+), 980 deletions(-) diff --git a/src/tests/lexer.rs b/src/tests/lexer.rs index 267bc70..016e39a 100644 --- a/src/tests/lexer.rs +++ b/src/tests/lexer.rs @@ -2,12 +2,12 @@ use crate::lexer::tokenize; #[test] fn test_lexer_all_kind() { - insta::assert_yaml_snapshot!(tokenize("foo != 123(]{.:").unwrap()); + insta::assert_yaml_snapshot!(tokenize("foo != 123(]{.:")); } #[test] fn test_lexer_negative_number() { - insta::assert_yaml_snapshot!(tokenize("-123.456").unwrap()); + insta::assert_yaml_snapshot!(tokenize("-123.456")); } #[test] diff --git a/src/tests/parser.rs b/src/tests/parser.rs index 2d31f6c..711eeed 100644 --- a/src/tests/parser.rs +++ b/src/tests/parser.rs @@ -4,13 +4,13 @@ use crate::parser::parse; #[test] fn test_parse_from_events_nested_data() { let tokens = tokenize(include_str!("./resources/from_events_nested_data.eql")).unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] fn test_parse_from_events_using_subquery() { let tokens = tokenize(include_str!("./resources/from_events_using_subquery.eql")).unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] @@ -19,7 +19,7 @@ fn test_parse_from_events_where_subject_project_record_with_count() { "./resources/from_events_where_subject_project_record_with_count.eql" )) .unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] @@ -28,7 +28,7 @@ fn test_parse_from_events_with_top_identity_projection() { "./resources/from_events_with_top_identity_projection.eql" )) .unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] @@ -37,19 +37,19 @@ fn test_parse_from_events_with_type_to_project_record() { "./resources/from_events_with_type_to_project_record.eql" )) .unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] fn test_parse_binary_op() { let tokens = tokenize(include_str!("./resources/parser_binary_op.eql")).unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] fn test_parser_unhinged_unary_op() { let tokens = tokenize(include_str!("./resources/parser_unhinged_unary_op.eql")).unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] @@ -58,25 +58,25 @@ fn test_parser_from_events_with_group_by_and_having() { "./resources/from_events_with_group_by_and_having.eql" )) .unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] fn test_parser_from_events_with_distinct() { let tokens = tokenize(include_str!("./resources/from_events_with_distinct.eql")).unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] fn test_parser_valid_contains() { let tokens = tokenize(include_str!("./resources/valid_contains.eql")).unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] fn test_parser_valid_type_conversion() { let tokens = tokenize(include_str!("./resources/valid_type_conversion.eql")).unwrap(); - insta::assert_yaml_snapshot!(parse(tokens.as_slice()).unwrap()); + insta::assert_yaml_snapshot!(parse(tokens.as_slice())); } #[test] diff --git a/src/tests/snapshots/eventql_parser__tests__lexer__lexer_all_kind.snap b/src/tests/snapshots/eventql_parser__tests__lexer__lexer_all_kind.snap index 2e1000f..ef2c8fc 100644 --- a/src/tests/snapshots/eventql_parser__tests__lexer__lexer_all_kind.snap +++ b/src/tests/snapshots/eventql_parser__tests__lexer__lexer_all_kind.snap @@ -1,39 +1,40 @@ --- source: src/tests/lexer.rs -expression: "tokenize(\"foo != 123(]{.:\").unwrap()" +expression: "tokenize(\"foo != 123(]{.:\")" --- -- sym: - Id: foo - line: 1 - col: 1 -- sym: - Operator: Neq - line: 1 - col: 5 -- sym: - Number: 123 - line: 1 - col: 8 -- sym: - Symbol: OpenParen - line: 1 - col: 11 -- sym: - Symbol: CloseBracket - line: 1 - col: 12 -- sym: - Symbol: OpenBrace - line: 1 - col: 13 -- sym: - Symbol: Dot - line: 1 - col: 14 -- sym: - Symbol: Colon - line: 1 - col: 15 -- sym: Eof - line: 1 - col: 16 +Ok: + - sym: + Id: foo + line: 1 + col: 1 + - sym: + Operator: Neq + line: 1 + col: 5 + - sym: + Number: 123 + line: 1 + col: 8 + - sym: + Symbol: OpenParen + line: 1 + col: 11 + - sym: + Symbol: CloseBracket + line: 1 + col: 12 + - sym: + Symbol: OpenBrace + line: 1 + col: 13 + - sym: + Symbol: Dot + line: 1 + col: 14 + - sym: + Symbol: Colon + line: 1 + col: 15 + - sym: Eof + line: 1 + col: 16 diff --git a/src/tests/snapshots/eventql_parser__tests__lexer__lexer_negative_number.snap b/src/tests/snapshots/eventql_parser__tests__lexer__lexer_negative_number.snap index 8512b33..cb79731 100644 --- a/src/tests/snapshots/eventql_parser__tests__lexer__lexer_negative_number.snap +++ b/src/tests/snapshots/eventql_parser__tests__lexer__lexer_negative_number.snap @@ -1,15 +1,16 @@ --- source: src/tests/lexer.rs -expression: "tokenize(\"-123.456\").unwrap()" +expression: "tokenize(\"-123.456\")" --- -- sym: - Operator: Sub - line: 1 - col: 1 -- sym: - Number: 123.456 - line: 1 - col: 2 -- sym: Eof - line: 1 - col: 9 +Ok: + - sym: + Operator: Sub + line: 1 + col: 1 + - sym: + Number: 123.456 + line: 1 + col: 2 + - sym: Eof + line: 1 + col: 9 diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parse_binary_op.snap b/src/tests/snapshots/eventql_parser__tests__parser__parse_binary_op.snap index 9e5853d..af4f366 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parse_binary_op.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parse_binary_op.snap @@ -1,158 +1,159 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 1 - col: 1 -sources: - - binding: - name: e - pos: - line: 1 - col: 6 - kind: - Name: events -predicate: - attrs: - pos: - line: 2 - col: 7 - value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 7 - value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 7 - value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 7 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 7 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 7 - value: - Id: e - field: data - field: foo - operator: Eq - rhs: - attrs: - pos: - line: 2 - col: 21 - value: - String: foobar - operator: And - rhs: - attrs: - pos: - line: 2 - col: 34 - value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 34 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 34 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 34 - value: - Id: e - field: data - field: foo - operator: Eq - rhs: - attrs: - pos: - line: 2 - col: 48 - value: - Number: 42 - operator: Or - rhs: - attrs: - pos: - line: 2 - col: 54 - value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 54 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 54 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 54 - value: - Id: e - field: data - field: foo - operator: Eq - rhs: - attrs: - pos: - line: 2 - col: 68 - value: - Number: 123 -group_by: ~ -order_by: ~ -limit: ~ -projection: +Ok: attrs: pos: - line: 3 - col: 14 - value: - Id: e -distinct: false -meta: ~ + line: 1 + col: 1 + sources: + - binding: + name: e + pos: + line: 1 + col: 6 + kind: + Name: events + predicate: + attrs: + pos: + line: 2 + col: 7 + value: + Binary: + lhs: + attrs: + pos: + line: 2 + col: 7 + value: + Binary: + lhs: + attrs: + pos: + line: 2 + col: 7 + value: + Binary: + lhs: + attrs: + pos: + line: 2 + col: 7 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 7 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 7 + value: + Id: e + field: data + field: foo + operator: Eq + rhs: + attrs: + pos: + line: 2 + col: 21 + value: + String: foobar + operator: And + rhs: + attrs: + pos: + line: 2 + col: 34 + value: + Binary: + lhs: + attrs: + pos: + line: 2 + col: 34 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 34 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 34 + value: + Id: e + field: data + field: foo + operator: Eq + rhs: + attrs: + pos: + line: 2 + col: 48 + value: + Number: 42 + operator: Or + rhs: + attrs: + pos: + line: 2 + col: 54 + value: + Binary: + lhs: + attrs: + pos: + line: 2 + col: 54 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 54 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 54 + value: + Id: e + field: data + field: foo + operator: Eq + rhs: + attrs: + pos: + line: 2 + col: 68 + value: + Number: 123 + group_by: ~ + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 3 + col: 14 + value: + Id: e + distinct: false + meta: ~ diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_nested_data.snap b/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_nested_data.snap index f92a593..cf96ca3 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_nested_data.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_nested_data.snap @@ -1,106 +1,107 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 1 - col: 1 -sources: - - binding: - name: e - pos: - line: 1 - col: 6 - kind: - Name: events -predicate: - attrs: - pos: - line: 2 - col: 7 - value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 7 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 7 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 7 - value: - Id: e - field: data - field: price - operator: Gt - rhs: - attrs: - pos: - line: 2 - col: 22 - value: - Number: 20 -group_by: ~ -order_by: ~ -limit: ~ -projection: +Ok: attrs: pos: - line: 3 - col: 14 - value: - Record: - - name: id - value: - attrs: - pos: - line: 3 - col: 20 - value: - Access: - target: - attrs: - pos: - line: 3 - col: 20 - value: - Id: e - field: id - - name: price - value: + line: 1 + col: 1 + sources: + - binding: + name: e + pos: + line: 1 + col: 6 + kind: + Name: events + predicate: + attrs: + pos: + line: 2 + col: 7 + value: + Binary: + lhs: attrs: pos: - line: 3 - col: 33 + line: 2 + col: 7 value: Access: target: attrs: pos: - line: 3 - col: 33 + line: 2 + col: 7 value: Access: target: attrs: pos: - line: 3 - col: 33 + line: 2 + col: 7 value: Id: e field: data field: price -distinct: false -meta: ~ + operator: Gt + rhs: + attrs: + pos: + line: 2 + col: 22 + value: + Number: 20 + group_by: ~ + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 3 + col: 14 + value: + Record: + - name: id + value: + attrs: + pos: + line: 3 + col: 20 + value: + Access: + target: + attrs: + pos: + line: 3 + col: 20 + value: + Id: e + field: id + - name: price + value: + attrs: + pos: + line: 3 + col: 33 + value: + Access: + target: + attrs: + pos: + line: 3 + col: 33 + value: + Access: + target: + attrs: + pos: + line: 3 + col: 33 + value: + Id: e + field: data + field: price + distinct: false + meta: ~ diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_using_subquery.snap b/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_using_subquery.snap index cbdd732..f9c817c 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_using_subquery.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_using_subquery.snap @@ -1,152 +1,153 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 1 - col: 1 -sources: - - binding: - name: e - pos: - line: 1 - col: 6 - kind: - Subquery: - attrs: - pos: - line: 2 - col: 3 - sources: - - binding: - name: e - pos: - line: 2 - col: 8 - kind: - Name: events - predicate: - attrs: - pos: - line: 3 - col: 9 - value: - Binary: - lhs: - attrs: - pos: - line: 3 - col: 9 - value: - Access: - target: - attrs: - pos: - line: 3 - col: 9 - value: - Id: e - field: type - operator: Eq - rhs: - attrs: - pos: - line: 3 - col: 19 - value: - String: io.eventsourcingdb.library.book-acquired - group_by: ~ - order_by: ~ - limit: ~ - projection: +Ok: + attrs: + pos: + line: 1 + col: 1 + sources: + - binding: + name: e + pos: + line: 1 + col: 6 + kind: + Subquery: attrs: pos: - line: 4 - col: 16 - value: - Record: - - name: orderId - value: + line: 2 + col: 3 + sources: + - binding: + name: e + pos: + line: 2 + col: 8 + kind: + Name: events + predicate: + attrs: + pos: + line: 3 + col: 9 + value: + Binary: + lhs: attrs: pos: - line: 4 - col: 27 + line: 3 + col: 9 value: Access: target: attrs: pos: - line: 4 - col: 27 + line: 3 + col: 9 value: Id: e - field: id - - name: value - value: + field: type + operator: Eq + rhs: attrs: pos: - line: 4 - col: 40 + line: 3 + col: 19 value: - Access: - target: - attrs: - pos: - line: 4 - col: 40 - value: - Access: - target: - attrs: - pos: - line: 4 - col: 40 - value: - Id: e - field: data - field: total - distinct: false - meta: ~ -predicate: - attrs: - pos: - line: 6 - col: 7 - value: - Binary: - lhs: - attrs: - pos: - line: 6 - col: 7 - value: - Access: - target: - attrs: - pos: - line: 6 - col: 7 - value: - Id: e - field: value - operator: Gt - rhs: - attrs: - pos: - line: 6 - col: 17 - value: - Number: 100 -group_by: ~ -order_by: ~ -limit: ~ -projection: - attrs: - pos: - line: 7 - col: 14 - value: - Id: e -distinct: false -meta: ~ + String: io.eventsourcingdb.library.book-acquired + group_by: ~ + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 4 + col: 16 + value: + Record: + - name: orderId + value: + attrs: + pos: + line: 4 + col: 27 + value: + Access: + target: + attrs: + pos: + line: 4 + col: 27 + value: + Id: e + field: id + - name: value + value: + attrs: + pos: + line: 4 + col: 40 + value: + Access: + target: + attrs: + pos: + line: 4 + col: 40 + value: + Access: + target: + attrs: + pos: + line: 4 + col: 40 + value: + Id: e + field: data + field: total + distinct: false + meta: ~ + predicate: + attrs: + pos: + line: 6 + col: 7 + value: + Binary: + lhs: + attrs: + pos: + line: 6 + col: 7 + value: + Access: + target: + attrs: + pos: + line: 6 + col: 7 + value: + Id: e + field: value + operator: Gt + rhs: + attrs: + pos: + line: 6 + col: 17 + value: + Number: 100 + group_by: ~ + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 7 + col: 14 + value: + Id: e + distinct: false + meta: ~ diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_where_subject_project_record_with_count.snap b/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_where_subject_project_record_with_count.snap index 64bffd5..4d13a52 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_where_subject_project_record_with_count.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_where_subject_project_record_with_count.snap @@ -1,68 +1,69 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 1 - col: 1 -sources: - - binding: - name: e - pos: - line: 1 - col: 6 - kind: - Name: events -predicate: - attrs: - pos: - line: 2 - col: 7 - value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 7 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 7 - value: - Id: e - field: subject - operator: Eq - rhs: - attrs: - pos: - line: 2 - col: 20 - value: - String: /books/42 -group_by: ~ -order_by: ~ -limit: ~ -projection: +Ok: attrs: pos: - line: 3 - col: 14 - value: - Record: - - name: total - value: + line: 1 + col: 1 + sources: + - binding: + name: e + pos: + line: 1 + col: 6 + kind: + Name: events + predicate: + attrs: + pos: + line: 2 + col: 7 + value: + Binary: + lhs: attrs: pos: - line: 3 - col: 23 + line: 2 + col: 7 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 7 + value: + Id: e + field: subject + operator: Eq + rhs: + attrs: + pos: + line: 2 + col: 20 + value: + String: /books/42 + group_by: ~ + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 3 + col: 14 + value: + Record: + - name: total value: - App: - func: COUNT - args: [] -distinct: false -meta: ~ + attrs: + pos: + line: 3 + col: 23 + value: + App: + func: COUNT + args: [] + distinct: false + meta: ~ diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_with_top_identity_projection.snap b/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_with_top_identity_projection.snap index 73034b2..49c4c01 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_with_top_identity_projection.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_with_top_identity_projection.snap @@ -1,46 +1,47 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 1 - col: 1 -sources: - - binding: - name: e - pos: - line: 1 - col: 6 - kind: - Name: events -predicate: ~ -group_by: ~ -order_by: - expr: +Ok: + attrs: + pos: + line: 1 + col: 1 + sources: + - binding: + name: e + pos: + line: 1 + col: 6 + kind: + Name: events + predicate: ~ + group_by: ~ + order_by: + expr: + attrs: + pos: + line: 2 + col: 10 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 10 + value: + Id: e + field: time + order: Desc + limit: + Top: 100 + projection: attrs: pos: - line: 2 - col: 10 + line: 4 + col: 14 value: - Access: - target: - attrs: - pos: - line: 2 - col: 10 - value: - Id: e - field: time - order: Desc -limit: - Top: 100 -projection: - attrs: - pos: - line: 4 - col: 14 - value: - Id: e -distinct: false -meta: ~ + Id: e + distinct: false + meta: ~ diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_with_type_to_project_record.snap b/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_with_type_to_project_record.snap index c66e00a..f0de686 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_with_type_to_project_record.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parse_from_events_with_type_to_project_record.snap @@ -1,98 +1,99 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 1 - col: 1 -sources: - - binding: - name: e - pos: - line: 1 - col: 6 - kind: - Name: events -predicate: - attrs: - pos: - line: 2 - col: 7 - value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 7 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 7 - value: - Id: e - field: type - operator: Eq - rhs: - attrs: - pos: - line: 2 - col: 17 - value: - String: io.eventsourcingdb.library.book-acquired -group_by: ~ -order_by: ~ -limit: ~ -projection: +Ok: attrs: pos: - line: 3 - col: 14 - value: - Record: - - name: id - value: + line: 1 + col: 1 + sources: + - binding: + name: e + pos: + line: 1 + col: 6 + kind: + Name: events + predicate: + attrs: + pos: + line: 2 + col: 7 + value: + Binary: + lhs: attrs: pos: - line: 3 - col: 20 + line: 2 + col: 7 value: Access: target: attrs: pos: - line: 3 - col: 20 + line: 2 + col: 7 value: Id: e - field: id - - name: book - value: + field: type + operator: Eq + rhs: attrs: pos: - line: 3 - col: 32 + line: 2 + col: 17 value: - Access: - target: - attrs: - pos: - line: 3 - col: 32 - value: - Access: - target: - attrs: - pos: - line: 3 - col: 32 - value: - Id: e - field: data - field: title -distinct: false -meta: ~ + String: io.eventsourcingdb.library.book-acquired + group_by: ~ + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 3 + col: 14 + value: + Record: + - name: id + value: + attrs: + pos: + line: 3 + col: 20 + value: + Access: + target: + attrs: + pos: + line: 3 + col: 20 + value: + Id: e + field: id + - name: book + value: + attrs: + pos: + line: 3 + col: 32 + value: + Access: + target: + attrs: + pos: + line: 3 + col: 32 + value: + Access: + target: + attrs: + pos: + line: 3 + col: 32 + value: + Id: e + field: data + field: title + distinct: false + meta: ~ diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parser_from_events_with_distinct.snap b/src/tests/snapshots/eventql_parser__tests__parser__parser_from_events_with_distinct.snap index dc76513..d7e2678 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parser_from_events_with_distinct.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parser_from_events_with_distinct.snap @@ -1,106 +1,107 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 1 - col: 1 -sources: - - binding: - name: e - pos: - line: 1 - col: 6 - kind: - Name: events -predicate: - attrs: - pos: - line: 2 - col: 7 - value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 7 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 7 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 7 - value: - Id: e - field: data - field: price - operator: Gt - rhs: - attrs: - pos: - line: 2 - col: 22 - value: - Number: 20 -group_by: ~ -order_by: ~ -limit: ~ -projection: +Ok: attrs: pos: - line: 3 - col: 23 - value: - Record: - - name: id - value: - attrs: - pos: - line: 3 - col: 29 - value: - Access: - target: - attrs: - pos: - line: 3 - col: 29 - value: - Id: e - field: id - - name: price - value: + line: 1 + col: 1 + sources: + - binding: + name: e + pos: + line: 1 + col: 6 + kind: + Name: events + predicate: + attrs: + pos: + line: 2 + col: 7 + value: + Binary: + lhs: attrs: pos: - line: 3 - col: 42 + line: 2 + col: 7 value: Access: target: attrs: pos: - line: 3 - col: 42 + line: 2 + col: 7 value: Access: target: attrs: pos: - line: 3 - col: 42 + line: 2 + col: 7 value: Id: e field: data field: price -distinct: true -meta: ~ + operator: Gt + rhs: + attrs: + pos: + line: 2 + col: 22 + value: + Number: 20 + group_by: ~ + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 3 + col: 23 + value: + Record: + - name: id + value: + attrs: + pos: + line: 3 + col: 29 + value: + Access: + target: + attrs: + pos: + line: 3 + col: 29 + value: + Id: e + field: id + - name: price + value: + attrs: + pos: + line: 3 + col: 42 + value: + Access: + target: + attrs: + pos: + line: 3 + col: 42 + value: + Access: + target: + attrs: + pos: + line: 3 + col: 42 + value: + Id: e + field: data + field: price + distinct: true + meta: ~ diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parser_from_events_with_group_by_and_having.snap b/src/tests/snapshots/eventql_parser__tests__parser__parser_from_events_with_group_by_and_having.snap index 08c1f4d..d67152c 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parser_from_events_with_group_by_and_having.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parser_from_events_with_group_by_and_having.snap @@ -1,95 +1,96 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 2 - col: 1 -sources: - - binding: - name: e - pos: - line: 2 - col: 6 - kind: - Name: events -predicate: +Ok: attrs: pos: - line: 3 - col: 7 - value: - Binary: - lhs: - attrs: - pos: - line: 3 - col: 7 - value: - Access: - target: - attrs: - pos: - line: 3 - col: 7 - value: - Id: e - field: price - operator: Gt - rhs: - attrs: - pos: - line: 3 - col: 17 - value: - Number: 20 -group_by: - expr: - attrs: - pos: - line: 4 - col: 10 - value: - Access: - target: - attrs: - pos: - line: 4 - col: 10 - value: - Id: e - field: name + line: 2 + col: 1 + sources: + - binding: + name: e + pos: + line: 2 + col: 6 + kind: + Name: events predicate: attrs: pos: - line: 4 - col: 24 + line: 3 + col: 7 value: Binary: lhs: attrs: pos: - line: 4 - col: 24 + line: 3 + col: 7 value: - Id: name - operator: Neq + Access: + target: + attrs: + pos: + line: 3 + col: 7 + value: + Id: e + field: price + operator: Gt rhs: attrs: pos: - line: 4 - col: 32 + line: 3 + col: 17 value: - String: foo -order_by: ~ -limit: ~ -projection: - attrs: - pos: - line: 5 - col: 14 - value: - Id: e -distinct: false -meta: ~ + Number: 20 + group_by: + expr: + attrs: + pos: + line: 4 + col: 10 + value: + Access: + target: + attrs: + pos: + line: 4 + col: 10 + value: + Id: e + field: name + predicate: + attrs: + pos: + line: 4 + col: 24 + value: + Binary: + lhs: + attrs: + pos: + line: 4 + col: 24 + value: + Id: name + operator: Neq + rhs: + attrs: + pos: + line: 4 + col: 32 + value: + String: foo + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 5 + col: 14 + value: + Id: e + distinct: false + meta: ~ diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parser_unhinged_unary_op.snap b/src/tests/snapshots/eventql_parser__tests__parser__parser_unhinged_unary_op.snap index 8eaa458..9f77750 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parser_unhinged_unary_op.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parser_unhinged_unary_op.snap @@ -1,67 +1,68 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 1 - col: 1 -sources: - - binding: - name: e - pos: - line: 1 - col: 6 - kind: - Name: events -predicate: - attrs: - pos: - line: 2 - col: 7 - value: - Unary: - operator: Not - expr: - attrs: - pos: - line: 2 - col: 11 - value: - Unary: - operator: Not - expr: - attrs: - pos: - line: 2 - col: 15 - value: - Unary: - operator: Not - expr: - attrs: - pos: - line: 2 - col: 19 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 19 - value: - Id: e - field: enabled -group_by: ~ -order_by: ~ -limit: ~ -projection: +Ok: attrs: pos: - line: 3 - col: 14 - value: - Id: e -distinct: false -meta: ~ + line: 1 + col: 1 + sources: + - binding: + name: e + pos: + line: 1 + col: 6 + kind: + Name: events + predicate: + attrs: + pos: + line: 2 + col: 7 + value: + Unary: + operator: Not + expr: + attrs: + pos: + line: 2 + col: 11 + value: + Unary: + operator: Not + expr: + attrs: + pos: + line: 2 + col: 15 + value: + Unary: + operator: Not + expr: + attrs: + pos: + line: 2 + col: 19 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 19 + value: + Id: e + field: enabled + group_by: ~ + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 3 + col: 14 + value: + Id: e + distinct: false + meta: ~ diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parser_valid_contains.snap b/src/tests/snapshots/eventql_parser__tests__parser__parser_valid_contains.snap index 9e28961..2c22a76 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parser_valid_contains.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parser_valid_contains.snap @@ -1,84 +1,85 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 1 - col: 1 -sources: - - binding: - name: e - pos: - line: 1 - col: 6 - kind: - Name: events -predicate: - attrs: - pos: - line: 2 - col: 7 - value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 7 - value: - Array: - - attrs: - pos: - line: 2 - col: 8 - value: - Number: 1 - - attrs: - pos: - line: 2 - col: 10 - value: - Number: 2 - - attrs: - pos: - line: 2 - col: 12 - value: - Number: 3 - operator: Contains - rhs: - attrs: - pos: - line: 2 - col: 24 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 24 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 24 - value: - Id: e - field: data - field: price -group_by: ~ -order_by: ~ -limit: ~ -projection: +Ok: attrs: pos: - line: 3 - col: 14 - value: - Id: e -distinct: false -meta: ~ + line: 1 + col: 1 + sources: + - binding: + name: e + pos: + line: 1 + col: 6 + kind: + Name: events + predicate: + attrs: + pos: + line: 2 + col: 7 + value: + Binary: + lhs: + attrs: + pos: + line: 2 + col: 7 + value: + Array: + - attrs: + pos: + line: 2 + col: 8 + value: + Number: 1 + - attrs: + pos: + line: 2 + col: 10 + value: + Number: 2 + - attrs: + pos: + line: 2 + col: 12 + value: + Number: 3 + operator: Contains + rhs: + attrs: + pos: + line: 2 + col: 24 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 24 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 24 + value: + Id: e + field: data + field: price + group_by: ~ + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 3 + col: 14 + value: + Id: e + distinct: false + meta: ~ diff --git a/src/tests/snapshots/eventql_parser__tests__parser__parser_valid_type_conversion.snap b/src/tests/snapshots/eventql_parser__tests__parser__parser_valid_type_conversion.snap index 4466da2..4c0b089 100644 --- a/src/tests/snapshots/eventql_parser__tests__parser__parser_valid_type_conversion.snap +++ b/src/tests/snapshots/eventql_parser__tests__parser__parser_valid_type_conversion.snap @@ -1,68 +1,69 @@ --- source: src/tests/parser.rs -expression: parse(tokens.as_slice()).unwrap() +expression: parse(tokens.as_slice()) --- -attrs: - pos: - line: 1 - col: 1 -sources: - - binding: - name: e - pos: - line: 1 - col: 6 - kind: - Name: events -predicate: ~ -group_by: ~ -order_by: ~ -limit: ~ -projection: +Ok: attrs: pos: - line: 2 - col: 14 - value: - Record: - - name: date - value: - attrs: - pos: - line: 2 - col: 22 + line: 1 + col: 1 + sources: + - binding: + name: e + pos: + line: 1 + col: 6 + kind: + Name: events + predicate: ~ + group_by: ~ + order_by: ~ + limit: ~ + projection: + attrs: + pos: + line: 2 + col: 14 + value: + Record: + - name: date value: - Binary: - lhs: - attrs: - pos: - line: 2 - col: 22 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 22 - value: - Access: - target: - attrs: - pos: - line: 2 - col: 22 - value: - Id: e - field: data - field: date - operator: As - rhs: - attrs: - pos: - line: 2 - col: 37 - value: - Id: DATETIME -distinct: false -meta: ~ + attrs: + pos: + line: 2 + col: 22 + value: + Binary: + lhs: + attrs: + pos: + line: 2 + col: 22 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 22 + value: + Access: + target: + attrs: + pos: + line: 2 + col: 22 + value: + Id: e + field: data + field: date + operator: As + rhs: + attrs: + pos: + line: 2 + col: 37 + value: + Id: DATETIME + distinct: false + meta: ~