Skip to content

Commit

Permalink
add three tests for overlapping ranges (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel authored Jun 15, 2022
1 parent 8f1d2fa commit 676fd7d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions inst/tinytest/test_querycondition.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,19 @@ qc <- parse_query_condition(year < 2008 || year > 2010)
arr <- tiledb_array(uri, as.data.frame=TRUE, query_condition=qc)
expect_equal(NROW(arr[]),
sum(with(penguins, year < 2008 | year > 2010)))

## Overlapping ranges
qc <- parse_query_condition(year < 2009 && year < 2010)
arr <- tiledb_array(uri, as.data.frame=TRUE, query_condition=qc)
expect_equal(NROW(arr[]),
sum(with(penguins, year < 2009)))

qc <- parse_query_condition(year <= 2009 && year >= 2009)
arr <- tiledb_array(uri, as.data.frame=TRUE, query_condition=qc)
expect_equal(NROW(arr[]),
sum(with(penguins, year == 2009)))

qc <- parse_query_condition(year < 2009 || year < 2010)
arr <- tiledb_array(uri, as.data.frame=TRUE, query_condition=qc)
expect_equal(NROW(arr[]),
sum(with(penguins, year < 2010)))

0 comments on commit 676fd7d

Please sign in to comment.