blob: 197424b4fbe4ee67fa3a1b5ac703049c6409b985 [file] [log] [blame]
test_that("queryStringToLabel works correctly", {
expect_equivalent(queryStringToLabel(
c(
"referTo=x & textClass = /natur.*/ & creationDate in 2013",
"referTo=x & textClass = /natur.*/ & creationDate in 2014"
)
),
c("2013", "2014"))
expect_equivalent(queryStringToLabel(
c(
"referTo=x & textClass = /natur.*/ & pubDate in 2013",
"referTo=x & textClass = /freizeit.*/ & pubDate in 2014"
), pubDateOnly = T
),
c("2013", "2014"))
expect_equivalent(queryStringToLabel(
c(
"referTo=x & textClass = /natur.*/ & creationDate in 2013",
"referTo=x & textClass = /freizeit.*/ & creationDate in 2014"
), pubDateOnly = T
),
c("2013", "2014"))
expect_equivalent(queryStringToLabel(
c(
"referTo=x & textClass = /natur.*/ & creationDate in 2013",
"referTo=x & textClass = /freizeit.*/ & creationDate in 2014"
), excludePubDate = T
),
c("/natur.*/", "/freizeit.*/"))
})