Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update tests to use output files #47

Merged
merged 6 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
73 changes: 73 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ geozero = "0.14.0"
lazy_static = "1.5"
pest = "2.7"
pest_derive = { version = "2.7", features = ["grammar-extras"] }
pg_escape = "0.1.1"
serde = "1.0"
serde_derive = "1.0"
serde_json = { version = "1.0", features = ["preserve_order"] }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 12 additions & 5 deletions src/expr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{Error, Geometry, SqlQuery, Validator};
use pg_escape::{quote_identifier, quote_literal};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::str::FromStr;
Expand Down Expand Up @@ -63,8 +64,8 @@ impl Expr {
match self {
Expr::Bool(v) => Ok(v.to_string()),
Expr::Float(v) => Ok(v.to_string()),
Expr::Literal(v) => Ok(format!("'{}'", v)),
Expr::Property { property } => Ok(format!("\"{property}\"")),
Expr::Literal(v) => Ok(quote_literal(v).to_string()),
Expr::Property { property } => Ok(quote_identifier(property).to_string()),
Expr::Interval { interval } => {
check_len!(
"interval",
Expand All @@ -90,6 +91,8 @@ impl Expr {
match op.as_str() {
"and" => Ok(format!("({})", a.join(" AND "))),
"or" => Ok(format!("({})", a.join(" OR "))),
"like" => Ok(format!("({} LIKE {})", a[0], a[1])),
"in" => Ok(format!("({} IN {})", a[0], a[1])),
"between" => {
check_len!(
"between",
Expand All @@ -101,13 +104,17 @@ impl Expr {
"not" => {
check_len!("not", a, 1, format!("(NOT {})", a[0]))
}
"is null" => {
"isNull" => {
check_len!("is null", a, 1, format!("({} IS NULL)", a[0]))
}
"+" | "-" | "*" | "/" | "%" | "^" | "=" | "<=" | "<" | "<>" | ">" | ">=" => {
"+" | "-" | "*" | "/" | "%" => {
let paddedop = format!(" {} ", op);
Ok(a.join(&paddedop).to_string())
}
"^" | "=" | "<=" | "<" | "<>" | ">" | ">=" => {
check_len!(op, a, 2, format!("({} {} {})", a[0], op, a[1]))
}
_ => Ok(format!("{}({})", op, a.join(", "))),
_ => Ok(format!("{}({})", quote_identifier(op), a.join(", "))),
}
}
Expr::BBox { bbox } => {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub struct SqlQuery {
/// # Examples
///
/// ```
/// let s = include_str!("../fixtures/json/example01.json");
/// let s = include_str!("../examples/json/example01.json");
/// let expr = cql2::parse_json(s);
/// ```
pub fn parse_json(s: &str) -> Result<Expr, serde_json::Error> {
Expand All @@ -71,7 +71,7 @@ pub fn parse_json(s: &str) -> Result<Expr, serde_json::Error> {
/// # Examples
///
/// ```no_run
/// let expr = cql2::parse_file("tests/fixtures/json/example01.json");
/// let expr = cql2::parse_file("tests/examples/json/example01.json");
/// ```
pub fn parse_file(path: impl AsRef<Path>) -> Result<Expr, Error> {
let s = fs::read_to_string(path)?;
Expand Down
20 changes: 14 additions & 6 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ fn parse_expr(expression_pairs: Pairs<'_, Rule>) -> Result<Expr, Error> {
let mut outargs: Vec<Box<Expr>> = Vec::new();

match lhsclone {
Expr::Operation { ref op, ref args } if op == "and" => {
Expr::Operation { ref op, ref args } if op == "and" && op == &opstring => {
for arg in args.iter() {
outargs.push(arg.clone());
}
outargs.push(Box::new(rhsclone));
return Ok(Expr::Operation {
op: "and".to_string(),
op: opstring,
args: outargs,
});
}
Expand Down Expand Up @@ -298,13 +298,21 @@ fn parse_expr(expression_pairs: Pairs<'_, Rule>) -> Result<Expr, Error> {
})
.map_postfix(|child, op| {
let child = child?;
match op.as_rule() {
Rule::IsNullPostfix => Ok(Expr::Operation {
let notflag = &op.clone().into_inner().next().is_some();
let retexpr = match op.as_rule() {
Rule::IsNullPostfix => Expr::Operation {
op: "isNull".to_string(),
args: vec![Box::new(child)],
}),
},
rule => unreachable!("Expr::parse expected postfix operator, found {:?}", rule),
}
};
if *notflag {
return Ok(Expr::Operation {
op: "not".to_string(),
args: vec![Box::new(retexpr)],
});
};
Ok(retexpr)
})
.parse(expression_pairs)
}
Expand Down
4 changes: 3 additions & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ The top level `examples` directory is copied directly from <https://github.com/o

## Expected test output

To generate:
Expected files should end with ".out". The first line of each test should be the input in either CQL2 Text or CQL2 JSON. The second line is the expected output in CQL2 Text. The third line is the expected output in CQL2 JSON. All input should be formatted to fit in a single line.

To generate expected files using the ogc examples:

```shell
tests/generate-expected
Expand Down
3 changes: 3 additions & 0 deletions tests/expected/clause6_01.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"avg","args":[{"property":"windSpeed"}]}
avg("windSpeed")
{"op":"avg","args":[{"property":"windSpeed"}]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
avg(windSpeed)
avg("windSpeed")
{"op":"avg","args":[{"property":"windSpeed"}]}
3 changes: 3 additions & 0 deletions tests/expected/clause6_02a.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"=","args":[{"property":"city"},"Toronto"]}
(city = 'Toronto')
{"op":"=","args":[{"property":"city"},"Toronto"]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
city='Toronto'
(city = 'Toronto')
{"op":"=","args":[{"property":"city"},"Toronto"]}
3 changes: 3 additions & 0 deletions tests/expected/clause6_02b.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"<","args":[{"op":"avg","args":[{"property":"windSpeed"}]},4]}
(avg("windSpeed") < 4)
{"op":"<","args":[{"op":"avg","args":[{"property":"windSpeed"}]},4.0]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
avg(windSpeed) < 4
(avg("windSpeed") < 4)
{"op":"<","args":[{"op":"avg","args":[{"property":"windSpeed"}]},4.0]}
3 changes: 3 additions & 0 deletions tests/expected/clause6_02c.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":">","args":[{"op":"-","args":[{"property":"balance"},150.0]},0]}
(balance - 150 > 0)
{"op":">","args":[{"op":"-","args":[{"property":"balance"},150.0]},0.0]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
balance-150.0 > 0
(balance - 150 > 0)
{"op":">","args":[{"op":"-","args":[{"property":"balance"},150.0]},0.0]}
3 changes: 3 additions & 0 deletions tests/expected/clause6_02d.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":">=","args":[{"property":"updated"},{"date":"1970-01-01"}]}
(updated >= DATE('1970-01-01'))
{"op":">=","args":[{"property":"updated"},{"date":"1970-01-01"}]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
updated >= date('1970-01-01')
(updated >= DATE('1970-01-01'))
{"op":">=","args":[{"property":"updated"},{"date":"1970-01-01"}]}
3 changes: 3 additions & 0 deletions tests/expected/clause6_03.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"not","args":[{"op":"isNull","args":[{"property":"geometry"}]}]}
(NOT (geometry IS NULL))
{"op":"not","args":[{"op":"isNull","args":[{"property":"geometry"}]}]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
geometry IS NOT NULL
(NOT (geometry IS NULL))
{"op":"not","args":[{"op":"isNull","args":[{"property":"geometry"}]}]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_01.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"like","args":[{"property":"name"},"Smith%"]}
(name LIKE 'Smith%')
{"op":"like","args":[{"property":"name"},"Smith%"]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
name LIKE 'Smith%'
(name LIKE 'Smith%')
{"op":"like","args":[{"property":"name"},"Smith%"]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_02.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"between","args":[{"property":"depth"},100.0,150.0]}
(depth BETWEEN 100 AND 150)
{"op":"between","args":[{"property":"depth"},100.0,150.0]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
depth BETWEEN 100.0 and 150.0
(depth BETWEEN 100 AND 150)
{"op":"between","args":[{"property":"depth"},100.0,150.0]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_03a.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"in","args":[{"property":"cityName"},["Toronto","Frankfurt","Tokyo","New York"]]}
("cityName" IN ('Toronto', 'Frankfurt', 'Tokyo', 'New York'))
{"op":"in","args":[{"property":"cityName"},["Toronto","Frankfurt","Tokyo","New York"]]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_03a.txt.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cityName IN ('Toronto','Frankfurt','Tokyo','New York')
("cityName" IN ('Toronto', 'Frankfurt', 'Tokyo', 'New York'))
{"op":"in","args":[{"property":"cityName"},["Toronto","Frankfurt","Tokyo","New York"]]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_03b.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"not","args":[{"op":"in","args":[{"property":"category"},[1,2,3,4]]}]}
(NOT (category IN (1, 2, 3, 4)))
{"op":"not","args":[{"op":"in","args":[{"property":"category"},[1.0,2.0,3.0,4.0]]}]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
category NOT IN (1,2,3,4)
(NOT (category IN (1, 2, 3, 4)))
{"op":"not","args":[{"op":"in","args":[{"property":"category"},[1.0,2.0,3.0,4.0]]}]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_04.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"in","args":[{"op":"casei","args":[{"property":"road_class"}]},[{"op":"casei","args":["Οδος"]},{"op":"casei","args":["Straße"]}]]}
(casei(road_class) IN (casei('Οδος'), casei('Straße')))
{"op":"in","args":[{"op":"casei","args":[{"property":"road_class"}]},[{"op":"casei","args":["Οδος"]},{"op":"casei","args":["Straße"]}]]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
CASEI(road_class) IN (CASEI('Οδος'),CASEI('Straße'))
(casei(road_class) IN (casei('Οδος'), casei('Straße')))
{"op":"in","args":[{"op":"casei","args":[{"property":"road_class"}]},[{"op":"casei","args":["Οδος"]},{"op":"casei","args":["Straße"]}]]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_05.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"=","args":[{"op":"accenti","args":[{"property":"etat_vol"}]},{"op":"accenti","args":["débárquér"]}]}
(accenti(etat_vol) = accenti('débárquér'))
{"op":"=","args":[{"op":"accenti","args":[{"property":"etat_vol"}]},{"op":"accenti","args":["débárquér"]}]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
ACCENTI(etat_vol) = ACCENTI('débárquér')
(accenti(etat_vol) = accenti('débárquér'))
{"op":"=","args":[{"op":"accenti","args":[{"property":"etat_vol"}]},{"op":"accenti","args":["débárquér"]}]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_07.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"s_intersects","args":[{"property":"geometry"},{"type":"Point","coordinates":[36.319836,32.288087]}]}
s_intersects(geometry, POINT(36.319836 32.288087))
{"op":"s_intersects","args":[{"property":"geometry"},{"type":"Point","coordinates":[36.319836,32.288087]}]}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
S_INTERSECTS(geometry,POINT(36.319836 32.288087))
s_intersects(geometry, POINT(36.319836 32.288087))
{"op":"s_intersects","args":[{"property":"geometry"},{"type":"Point","coordinates":[36.319836,32.288087]}]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_10.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"s_crosses","args":[{"property":"road"},{"type":"Polygon","coordinates":[[[43.7286,-79.2986],[43.7311,-79.2996],[43.7323,-79.2972],[43.7326,-79.2971],[43.7350,-79.2981],[43.7350,-79.2982],[43.7352,-79.2982],[43.7357,-79.2956],[43.7337,-79.2948],[43.7343,-79.2933],[43.7339,-79.2923],[43.7327,-79.2947],[43.7320,-79.2942],[43.7322,-79.2937],[43.7306,-79.2930],[43.7303,-79.2930],[43.7299,-79.2928],[43.7286,-79.2986]]]}]}
s_crosses(road, POLYGON((43.7286 -79.2986,43.7311 -79.2996,43.7323 -79.2972,43.7326 -79.2971,43.735 -79.2981,43.735 -79.2982,43.7352 -79.2982,43.7357 -79.2956,43.7337 -79.2948,43.7343 -79.2933,43.7339 -79.2923,43.7327 -79.2947,43.732 -79.2942,43.7322 -79.2937,43.7306 -79.293,43.7303 -79.293,43.7299 -79.2928,43.7286 -79.2986)))
{"op":"s_crosses","args":[{"property":"road"},{"type":"Polygon","coordinates":[[[43.7286,-79.2986],[43.7311,-79.2996],[43.7323,-79.2972],[43.7326,-79.2971],[43.735,-79.2981],[43.735,-79.2982],[43.7352,-79.2982],[43.7357,-79.2956],[43.7337,-79.2948],[43.7343,-79.2933],[43.7339,-79.2923],[43.7327,-79.2947],[43.732,-79.2942],[43.7322,-79.2937],[43.7306,-79.293],[43.7303,-79.293],[43.7299,-79.2928],[43.7286,-79.2986]]]}]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_10.txt.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
S_CROSSES(road,POLYGON((43.7286 -79.2986, 43.7311 -79.2996, 43.7323 -79.2972, 43.7326 -79.2971, 43.7350 -79.2981, 43.7350 -79.2982, 43.7352 -79.2982, 43.7357 -79.2956, 43.7337 -79.2948, 43.7343 -79.2933, 43.7339 -79.2923, 43.7327 -79.2947, 43.7320 -79.2942, 43.7322 -79.2937, 43.7306 -79.2930, 43.7303 -79.2930, 43.7299 -79.2928, 43.7286 -79.2986)))
s_crosses(road, POLYGON((43.7286 -79.2986, 43.7311 -79.2996, 43.7323 -79.2972, 43.7326 -79.2971, 43.7350 -79.2981, 43.7350 -79.2982, 43.7352 -79.2982, 43.7357 -79.2956, 43.7337 -79.2948, 43.7343 -79.2933, 43.7339 -79.2923, 43.7327 -79.2947, 43.7320 -79.2942, 43.7322 -79.2937, 43.7306 -79.2930, 43.7303 -79.2930, 43.7299 -79.2928, 43.7286 -79.2986)))
{"op":"s_crosses","args":[{"property":"road"},{"type":"Polygon","coordinates":[[[43.7286,-79.2986],[43.7311,-79.2996],[43.7323,-79.2972],[43.7326,-79.2971],[43.735,-79.2981],[43.735,-79.2982],[43.7352,-79.2982],[43.7357,-79.2956],[43.7337,-79.2948],[43.7343,-79.2933],[43.7339,-79.2923],[43.7327,-79.2947],[43.732,-79.2942],[43.7322,-79.2937],[43.7306,-79.293],[43.7303,-79.293],[43.7299,-79.2928],[43.7286,-79.2986]]]}]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_12.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"t_intersects","args":[{"property":"event_time"},{"interval":["1969-07-16T05:32:00Z","1969-07-24T16:50:35Z"]}]}
t_intersects(event_time, INTERVAL('1969-07-16T05:32:00Z','1969-07-24T16:50:35Z'))
{"op":"t_intersects","args":[{"property":"event_time"},{"interval":["1969-07-16T05:32:00Z","1969-07-24T16:50:35Z"]}]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_12.txt.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
T_INTERSECTS(event_time, INTERVAL('1969-07-16T05:32:00Z', '1969-07-24T16:50:35Z'))
t_intersects(event_time, INTERVAL('1969-07-16T05:32:00Z','1969-07-24T16:50:35Z'))
{"op":"t_intersects","args":[{"property":"event_time"},{"interval":["1969-07-16T05:32:00Z","1969-07-24T16:50:35Z"]}]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_13.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"t_during","args":[{"interval":[{"property":"touchdown"},{"property":"liftOff"}]},{"interval":["1969-07-16T13:32:00Z","1969-07-24T16:50:35Z"]}]}
t_during(INTERVAL(touchdown,"liftOff"), INTERVAL('1969-07-16T13:32:00Z','1969-07-24T16:50:35Z'))
{"op":"t_during","args":[{"interval":[{"property":"touchdown"},{"property":"liftOff"}]},{"interval":["1969-07-16T13:32:00Z","1969-07-24T16:50:35Z"]}]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_13.txt.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
T_DURING(INTERVAL(touchdown, liftOff), INTERVAL('1969-07-16T13:32:00Z', '1969-07-24T16:50:35Z'))
t_during(INTERVAL(touchdown,"liftOff"), INTERVAL('1969-07-16T13:32:00Z','1969-07-24T16:50:35Z'))
{"op":"t_during","args":[{"interval":[{"property":"touchdown"},{"property":"liftOff"}]},{"interval":["1969-07-16T13:32:00Z","1969-07-24T16:50:35Z"]}]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_15.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"a_contains","args":[{"property":"layer:ids"},["layers-ca","layers-us"]]}
a_contains("layer:ids", ('layers-ca', 'layers-us'))
{"op":"a_contains","args":[{"property":"layer:ids"},["layers-ca","layers-us"]]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_15.txt.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
A_CONTAINS(layer:ids, ('layers-ca','layers-us'))
a_contains("layer:ids", ('layers-ca', 'layers-us'))
{"op":"a_contains","args":[{"property":"layer:ids"},["layers-ca","layers-us"]]}
3 changes: 3 additions & 0 deletions tests/expected/clause7_16.json.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"op":"s_crosses","args":[{"type":"LineString","coordinates":[[43.72992,-79.2998],[43.73005,-79.2991],[43.73006,-79.2984],[43.73140,-79.2956],[43.73259,-79.2950],[43.73266,-79.2945],[43.73320,-79.2936],[43.73378,-79.2936],[43.73486,-79.2917]]},{"type":"Polygon","coordinates":[[[43.7286,-79.2986],[43.7311,-79.2996],[43.7323,-79.2972],[43.7326,-79.2971],[43.7350,-79.2981],[43.7350,-79.2982],[43.7352,-79.2982],[43.7357,-79.2956],[43.7337,-79.2948],[43.7343,-79.2933],[43.7339,-79.2923],[43.7327,-79.2947],[43.7320,-79.2942],[43.7322,-79.2937],[43.7306,-79.2930],[43.7303,-79.2930],[43.7299,-79.2928],[43.7286,-79.2986]]]}]}
s_crosses(LINESTRING(43.72992 -79.2998,43.73005 -79.2991,43.73006 -79.2984,43.7314 -79.2956,43.73259 -79.295,43.73266 -79.2945,43.7332 -79.2936,43.73378 -79.2936,43.73486 -79.2917), POLYGON((43.7286 -79.2986,43.7311 -79.2996,43.7323 -79.2972,43.7326 -79.2971,43.735 -79.2981,43.735 -79.2982,43.7352 -79.2982,43.7357 -79.2956,43.7337 -79.2948,43.7343 -79.2933,43.7339 -79.2923,43.7327 -79.2947,43.732 -79.2942,43.7322 -79.2937,43.7306 -79.293,43.7303 -79.293,43.7299 -79.2928,43.7286 -79.2986)))
{"op":"s_crosses","args":[{"type":"LineString","coordinates":[[43.72992,-79.2998],[43.73005,-79.2991],[43.73006,-79.2984],[43.7314,-79.2956],[43.73259,-79.295],[43.73266,-79.2945],[43.7332,-79.2936],[43.73378,-79.2936],[43.73486,-79.2917]]},{"type":"Polygon","coordinates":[[[43.7286,-79.2986],[43.7311,-79.2996],[43.7323,-79.2972],[43.7326,-79.2971],[43.735,-79.2981],[43.735,-79.2982],[43.7352,-79.2982],[43.7357,-79.2956],[43.7337,-79.2948],[43.7343,-79.2933],[43.7339,-79.2923],[43.7327,-79.2947],[43.732,-79.2942],[43.7322,-79.2937],[43.7306,-79.293],[43.7303,-79.293],[43.7299,-79.2928],[43.7286,-79.2986]]]}]}
Loading
Loading