Running ‘testthat.R’ [7s/8s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(polmineR)
  polmineR 0.7.7
  registry:  /tmp/RtmpaRTNtH/RLIBS_4232de31a7d/polmineR/extdata/cwb/registry
  interface: CQI.RcppCWB
  
  Attaching package: 'polmineR'
  
  The following object is masked from 'package:testthat':
  
      context
  
  > use("polmineR")
  ... registry already set to: /tmp/RtmpaRTNtH/RLIBS_4232de31a7d/polmineR/extdata/cwb/registry (unchanged)
  ... status: OK
  > 
  > test_check("polmineR")
  Error in check_id(corpus = corpus, p_attribute = p_attribute, id = id,  : 
    all corpus positions (cpos) need to be >= 0, not TRUE
  ── 1. Error: context-method for corpus (@test_context.R#17)  ───────────────────
  non-numeric argument to binary operator
  1: polmineR::context("REUTERS", query = "asdfasdf", pAttribute = "word") at testthat/test_context.R:17
  2: polmineR::context("REUTERS", query = "asdfasdf", pAttribute = "word")
  3: .local(.Object, ...)
  4: context(C$as.partition(), query = query, cqp = is.cqp, pAttribute = pAttribute, sAttribute = sAttribute, 
         stoplist = stoplist, positivelist = positivelist, regex = regex, count = count, 
         mc = mc, verbose = verbose, progress = progress)
  5: context(C$as.partition(), query = query, cqp = is.cqp, pAttribute = pAttribute, sAttribute = sAttribute, 
         stoplist = stoplist, positivelist = positivelist, regex = regex, count = count, 
         mc = mc, verbose = verbose, progress = progress)
  6: .local(.Object, ...)
  7: lapply(1:nrow(hits), function(i) {
         cbind(hit_no = i, .makeLeftRightCpos[[cposMethod]](hits[i, ], left, right, corpus, 
             sAttribute))
     })
  8: FUN(X[[i]], ...)
  9: cbind(hit_no = i, .makeLeftRightCpos[[cposMethod]](hits[i, ], left, right, corpus, 
         sAttribute))
  10: .makeLeftRightCpos[[cposMethod]](hits[i, ], left, right, corpus, sAttribute)
  
  Error in check_id(corpus = corpus, p_attribute = p_attribute, id = id,  : 
    all corpus positions (cpos) need to be >= 0, not TRUE
  ── 2. Error: context-method for partition (@test_context.R#38)  ────────────────
  all corpus positions (cpos) need to be <= attribute size, not TRUE
  1: polmineR::context(P, query = "asdfasdf", pAttribute = "word") at testthat/test_context.R:38
  2: polmineR::context(P, query = "asdfasdf", pAttribute = "word")
  3: .local(.Object, ...)
  4: cpos(.Object, query, pAttribute[1], cqp = cqp)
  5: cpos(.Object, query, pAttribute[1], cqp = cqp)
  6: .local(.Object, ...)
  7: CQI$cpos2struc(.Object@corpus, sAttribute, hits[, 1])
  8: cl_cpos2struc(corpus = corpus, s_attribute = sAttribute, cpos = cpos, registry = Sys.getenv("CORPUS_REGISTRY"))
  9: check_cpos(corpus = corpus, p_attribute = "word", cpos = cpos, registry = registry)
  10: stop("all corpus positions (cpos) need to be <= attribute size, not TRUE")
  
  Error in check_id(corpus = corpus, p_attribute = p_attribute, id = id,  : 
    all corpus positions (cpos) need to be >= 0, not TRUE
  ── 3. Error: cooccurrences-method for corpus (@test_cooccurrences.R#18)  ───────
  non-numeric argument to binary operator
  1: expect_equal(cooccurrences("REUTERS", query = "asdfasdf", pAttribute = "word"), NULL) at testthat/test_cooccurrences.R:18
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: cooccurrences("REUTERS", query = "asdfasdf", pAttribute = "word")
  5: cooccurrences("REUTERS", query = "asdfasdf", pAttribute = "word")
  6: .local(.Object, ...)
  7: context(.Object = .Object, query = query, cqp = is.cqp, pAttribute = pAttribute, 
         sAttribute = sAttribute, left = left, right = right, stoplist = stoplist, positivelist = positivelist, 
         regex = regex, count = TRUE, mc = mc, verbose = verbose, progress = progress)
  8: context(.Object = .Object, query = query, cqp = is.cqp, pAttribute = pAttribute, 
         sAttribute = sAttribute, left = left, right = right, stoplist = stoplist, positivelist = positivelist, 
         regex = regex, count = TRUE, mc = mc, verbose = verbose, progress = progress)
  9: .local(.Object, ...)
  10: context(C$as.partition(), query = query, cqp = is.cqp, pAttribute = pAttribute, sAttribute = sAttribute, 
         stoplist = stoplist, positivelist = positivelist, regex = regex, count = count, 
         mc = mc, verbose = verbose, progress = progress)
  11: context(C$as.partition(), query = query, cqp = is.cqp, pAttribute = pAttribute, sAttribute = sAttribute, 
         stoplist = stoplist, positivelist = positivelist, regex = regex, count = count, 
         mc = mc, verbose = verbose, progress = progress)
  12: .local(.Object, ...)
  13: lapply(1:nrow(hits), function(i) {
         cbind(hit_no = i, .makeLeftRightCpos[[cposMethod]](hits[i, ], left, right, corpus, 
             sAttribute))
     })
  14: FUN(X[[i]], ...)
  15: cbind(hit_no = i, .makeLeftRightCpos[[cposMethod]](hits[i, ], left, right, corpus, 
         sAttribute))
  16: .makeLeftRightCpos[[cposMethod]](hits[i, ], left, right, corpus, sAttribute)
  
  Error in check_id(corpus = corpus, p_attribute = p_attribute, id = id,  : 
    all corpus positions (cpos) need to be >= 0, not TRUE
  ── 4. Error: kwic-method for partition (@test_cooccurrences.R#45)  ─────────────
  all corpus positions (cpos) need to be <= attribute size, not TRUE
  1: expect_equal(cooccurrences(P, query = "asdfasdf", pAttribute = "word"), NULL) at testthat/test_cooccurrences.R:45
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: cooccurrences(P, query = "asdfasdf", pAttribute = "word")
  5: cooccurrences(P, query = "asdfasdf", pAttribute = "word")
  6: .local(.Object, ...)
  7: context(.Object = .Object, query = query, cqp = is.cqp, pAttribute = pAttribute, 
         sAttribute = sAttribute, left = left, right = right, stoplist = stoplist, positivelist = positivelist, 
         count = TRUE, mc = mc, verbose = verbose, progress = progress)
  8: context(.Object = .Object, query = query, cqp = is.cqp, pAttribute = pAttribute, 
         sAttribute = sAttribute, left = left, right = right, stoplist = stoplist, positivelist = positivelist, 
         count = TRUE, mc = mc, verbose = verbose, progress = progress)
  9: .local(.Object, ...)
  10: cpos(.Object, query, pAttribute[1], cqp = cqp)
  11: cpos(.Object, query, pAttribute[1], cqp = cqp)
  12: .local(.Object, ...)
  13: CQI$cpos2struc(.Object@corpus, sAttribute, hits[, 1])
  14: cl_cpos2struc(corpus = corpus, s_attribute = sAttribute, cpos = cpos, registry = Sys.getenv("CORPUS_REGISTRY"))
  15: check_cpos(corpus = corpus, p_attribute = "word", cpos = cpos, registry = registry)
  16: stop("all corpus positions (cpos) need to be <= attribute size, not TRUE")
  
  Error in check_id(corpus = corpus, p_attribute = p_attribute, id = id,  : 
    all corpus positions (cpos) need to be >= 0, not TRUE
  ── 5. Failure: cpos-method for corpus (@test_cpos.R#10)  ───────────────────────
  cpos("REUTERS", query = "asdfasdfasdfasdf") not equal to NULL.
  Types not compatible: character is not NULL
  
  Error in check_id(corpus = corpus, p_attribute = p_attribute, id = id,  : 
    all corpus positions (cpos) need to be >= 0, not TRUE
  ── 6. Error: cpos-method for partition (@test_cpos.R#21)  ──────────────────────
  all corpus positions (cpos) need to be <= attribute size, not TRUE
  1: expect_equal(cpos(P, query = "asdfasdfasdfasdf", pAttribute = "word"), NULL) at testthat/test_cpos.R:21
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: cpos(P, query = "asdfasdfasdfasdf", pAttribute = "word")
  5: cpos(P, query = "asdfasdfasdfasdf", pAttribute = "word")
  6: .local(.Object, ...)
  7: CQI$cpos2struc(.Object@corpus, sAttribute, hits[, 1])
  8: cl_cpos2struc(corpus = corpus, s_attribute = sAttribute, cpos = cpos, registry = Sys.getenv("CORPUS_REGISTRY"))
  9: check_cpos(corpus = corpus, p_attribute = "word", cpos = cpos, registry = registry)
  10: stop("all corpus positions (cpos) need to be <= attribute size, not TRUE")
  
  Error in check_id(corpus = corpus, p_attribute = p_attribute, id = id,  : 
    all corpus positions (cpos) need to be >= 0, not TRUE
  ── 7. Error: kwic-method for corpus (@test_kwic.R#18)  ─────────────────────────
  non-numeric argument to binary operator
  1: expect_equal(kwic("REUTERS", query = "asdfasdf", pAttribute = "word"), NULL) at testthat/test_kwic.R:18
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: kwic("REUTERS", query = "asdfasdf", pAttribute = "word")
  5: kwic("REUTERS", query = "asdfasdf", pAttribute = "word")
  6: .local(.Object, ...)
  7: apply(hits, 1, function(row) {
         left <- c((row[1] - left - 1):(row[1] - 1))
         right <- c((row[2] + 1):(row[2] + right + 1))
         list(left = left[left > 0], node = c(row[1]:row[2]), right = right[right <= cposMax])
     })
  8: FUN(newX[, i], ...)
  
  Error in check_id(corpus = corpus, p_attribute = p_attribute, id = id,  : 
    all corpus positions (cpos) need to be >= 0, not TRUE
  ── 8. Error: kwic-method for partition (@test_kwic.R#45)  ──────────────────────
  all corpus positions (cpos) need to be <= attribute size, not TRUE
  1: expect_equal(kwic(P, query = "asdfasdf", pAttribute = "word"), NULL) at testthat/test_kwic.R:45
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: kwic(P, query = "asdfasdf", pAttribute = "word")
  5: kwic(P, query = "asdfasdf", pAttribute = "word")
  6: .local(.Object, ...)
  7: context(.Object = .Object, query = query, cqp = cqp, pAttribute = pAttribute, sAttribute = sAttribute, 
         left = left, right = right, stoplist = stoplist, positivelist = positivelist, 
         regex = regex, count = FALSE, verbose = verbose)
  8: context(.Object = .Object, query = query, cqp = cqp, pAttribute = pAttribute, sAttribute = sAttribute, 
         left = left, right = right, stoplist = stoplist, positivelist = positivelist, 
         regex = regex, count = FALSE, verbose = verbose)
  9: .local(.Object, ...)
  10: cpos(.Object, query, pAttribute[1], cqp = cqp)
  11: cpos(.Object, query, pAttribute[1], cqp = cqp)
  12: .local(.Object, ...)
  13: CQI$cpos2struc(.Object@corpus, sAttribute, hits[, 1])
  14: cl_cpos2struc(corpus = corpus, s_attribute = sAttribute, cpos = cpos, registry = Sys.getenv("CORPUS_REGISTRY"))
  15: check_cpos(corpus = corpus, p_attribute = "word", cpos = cpos, registry = registry)
  16: stop("all corpus positions (cpos) need to be <= attribute size, not TRUE")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 76 SKIPPED: 0 FAILED: 8
  1. Error: context-method for corpus (@test_context.R#17) 
  2. Error: context-method for partition (@test_context.R#38) 
  3. Error: cooccurrences-method for corpus (@test_cooccurrences.R#18) 
  4. Error: kwic-method for partition (@test_cooccurrences.R#45) 
  5. Failure: cpos-method for corpus (@test_cpos.R#10) 
  6. Error: cpos-method for partition (@test_cpos.R#21) 
  7. Error: kwic-method for corpus (@test_kwic.R#18) 
  8. Error: kwic-method for partition (@test_kwic.R#45) 
  
  Error: testthat unit tests failed
  Execution halted