blob: 33d18f9b53945489ace79da4b4def904a178dfe1 [file] [log] [blame]
test_that("fetchNext works with maxFetch", {
skip_if_offline()
kco <- KorAPConnection(verbose = TRUE, cache = FALSE)
q <- kco %>% corpusQuery("Test", "pubDate since 2014", fields = c("sigle"))
q <- fetchNext(q, maxFetch = 75)
expect_equal(nrow(q@collectedMatches), 75)
cat("\n")
q <- fetchNext(q, maxFetch = 100)
expect_equal(nrow(q@collectedMatches), 175)
})
test_that("fetchNext works with randomizePageOrder", {
skip_if_offline()
kco <- KorAPConnection(verbose = TRUE, cache = FALSE)
q <- kco %>% corpusQuery("Test", "pubDate since 2014", fields = c("sigle"))
q <- fetchNext(q, maxFetch = 175, randomizePageOrder = T)
expect_equal(nrow(q@collectedMatches), 175)
cat("\n")
q <- fetchNext(q, maxFetch = 50, randomizePageOrder = T)
expect_equal(nrow(q@collectedMatches), 225)
})