Running ‘test-all.R’ [48s/46s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > library(testthat)
  > test_check("diffrprojects")
  Loading required package: diffrprojects
  Loading required package: stringb
  Loading required package: rtext
  ── 1. Failure: diff_align works on basic level (@test_diff_align.R#12)  ────────
  `{ ... }` threw an error.
  Message: replacement has 1 row, data has 0
  Class:   simpleError/error/condition
  
  ── 2. Error: diff_align works on basic level (@test_diff_align.R#23)  ──────────
  replacement has 1 row, data has 0
  1: expect_true({
         all(c(letters[1:3]) %in% diff_align("a\nb\nc", "")$token_1)
     }) at testthat/test_diff_align.R:23
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: c(letters[1:3]) %in% diff_align("a\nb\nc", "")$token_1 at testthat/test_diff_align.R:24
  5: diff_align("a\nb\nc", "")
  6: `[<-`(`*tmp*`, iffer, "type", value = "insertion")
  7: `[<-.data.frame`(`*tmp*`, iffer, "type", value = "insertion")
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 3. Error: diff_align works on level 2 (@test_diff_align.R#47)  ──────────────
  replacement has 1 row, data has 0
  1: expect_true({
         d <- diff_align("a\nc\ne", "a\nb\nc", maxDist = Inf)
         all("change" %in% d$type)
     }) at testthat/test_diff_align.R:47
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: diff_align("a\nc\ne", "a\nb\nc", maxDist = Inf) at testthat/test_diff_align.R:48
  5: `[<-`(`*tmp*`, iffer, "type", value = "deletion")
  6: `[<-.data.frame`(`*tmp*`, iffer, "type", value = "deletion")
  7: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 4. Error: diffrproject text_align works (@test_dp_align.r#10)  ──────────────
  replacement has 1 row, data has 0
  1: expect_true({
         dp <- diffrproject$new()
         dp$text_add(text = "a\nb")
         dp$text_add(text = "")
         dp$text_add(text = "b\n")
         dp$text_link()
         names(dp$text)
         dp$text_align()
         length(dp$alignment) == 2 & all(dim(as.data.frame(dp$alignment)) == c(3, 10))
     }) at testthat/test_dp_align.r:10
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: dp$text_align() at testthat/test_dp_align.r:17
  5: self$text_align(self$link[[i]]$from, self$link[[i]]$to, tokenizer = tokenizer, ignore = ignore, 
         clean = clean, distance = distance, useBytes = useBytes, weight = weight, maxDist = maxDist, 
         q = q, p = p, nthread = nthread, verbose = verbose, ...)
  6: diff_align(tt1, tt2, tokenizer = tokenizer, ignore = ignore, clean = clean, distance = distance, 
         useBytes = useBytes, weight = weight, maxDist = maxDist, q = q, p = p, nthread = nthread, 
         verbose = verbose, ...)
  7: `[<-`(`*tmp*`, iffer, "type", value = "insertion")
  8: `[<-.data.frame`(`*tmp*`, iffer, "type", value = "insertion")
  9: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 5. Error: diffrproject alignment_delete works (@test_dp_align.r#87)  ────────
  replacement has 1 row, data has 0
  1: expect_true({
         dp <- diffrproject$new()
         dp$text_add("kdsajhfsadlkfhdsaf")
         dp$text_add("asdfklsadfm.samdfasf")
         dp$text_add("asdfklseadasdfwqwwer.samdfagsf")
         dp$text_link()
         dp$text_align(tokenizer = function(x) {
             text_tokenize(x, "")
         })
         dp$alignment
         dp$alignment_delete(1, 1)
         dp$alignment_delete(2, 1)
         sum(vapply(dp$alignment, function(x) {
             sum(x$alignment_i %in% 1)
         }, 1)) == 0
     }) at testthat/test_dp_align.r:87
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: dp$text_align(tokenizer = function(x) {
         text_tokenize(x, "")
     }) at testthat/test_dp_align.r:93
  5: self$text_align(self$link[[i]]$from, self$link[[i]]$to, tokenizer = tokenizer, ignore = ignore, 
         clean = clean, distance = distance, useBytes = useBytes, weight = weight, maxDist = maxDist, 
         q = q, p = p, nthread = nthread, verbose = verbose, ...)
  6: diff_align(tt1, tt2, tokenizer = tokenizer, ignore = ignore, clean = clean, distance = distance, 
         useBytes = useBytes, weight = weight, maxDist = maxDist, q = q, p = p, nthread = nthread, 
         verbose = verbose, ...)
  7: `[<-`(`*tmp*`, iffer, "type", value = "deletion")
  8: `[<-.data.frame`(`*tmp*`, iffer, "type", value = "deletion")
  9: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 6. Error: diffrproject alignment_data_set() (@test_dp_align.r#147)  ─────────
  replacement has 1 row, data has 0
  1: expect_true({
         dp <- diffrproject$new()$text_add(list("abcd", "bcdaa", "ccdabbcd"))$text_link()$debug()$text_align(tokenizer = function(x) {
             text_tokenize(x, "")
         })
         dp$alignment_data_set(link = 1, alignment_i = 1, x = "test_var", val = 3)
         dp$alignment_data_set(link = 1, alignment_i = 1:4, x = "y", val = 2)
         dp$alignment_data_set(link = 2, alignment_i = 1:9, x = "y", val = 2)
         df <- as.data.frame(dp$alignment_data)
         all(c("alignment_i", "hl", "link") %in% names(df))
     }) at testthat/test_dp_align.r:147
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: diffrproject$new()$text_add(list("abcd", "bcdaa", "ccdabbcd"))$text_link()$debug()$text_align(tokenizer = function(x) {
         text_tokenize(x, "")
     }) at testthat/test_dp_align.r:148
  5: self$text_align(self$link[[i]]$from, self$link[[i]]$to, tokenizer = tokenizer, ignore = ignore, 
         clean = clean, distance = distance, useBytes = useBytes, weight = weight, maxDist = maxDist, 
         q = q, p = p, nthread = nthread, verbose = verbose, ...)
  6: diff_align(tt1, tt2, tokenizer = tokenizer, ignore = ignore, clean = clean, distance = distance, 
         useBytes = useBytes, weight = weight, maxDist = maxDist, q = q, p = p, nthread = nthread, 
         verbose = verbose, ...)
  7: `[<-`(`*tmp*`, iffer, "type", value = "deletion")
  8: `[<-.data.frame`(`*tmp*`, iffer, "type", value = "deletion")
  9: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 7. Error: diffrproject alignment_data_code() (@test_dp_align.r#221)  ────────
  replacement has 1 row, data has 0
  1: expect_true({
         dp <- diffrproject$new()$text_add(list("abcd", "bcdaa", "ccdabbcd"))$text_link()$debug()$text_align(tokenizer = function(x) {
             text_tokenize(x, "")
         })
         dp$alignment_code(link = 1, alignment_i = 1, x = "test_var", val = 3)
         dp$alignment_code(link = 1, alignment_i = 1:4, x = "y", val = 2)
         dp$alignment_code(link = 2, alignment_i = 1:9, x = "y", val = 2)
         df <- as.data.frame(dp$alignment_data)
         all(c("alignment_i", "hl", "link") %in% names(df))
     }) at testthat/test_dp_align.r:221
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: diffrproject$new()$text_add(list("abcd", "bcdaa", "ccdabbcd"))$text_link()$debug()$text_align(tokenizer = function(x) {
         text_tokenize(x, "")
     }) at testthat/test_dp_align.r:222
  5: self$text_align(self$link[[i]]$from, self$link[[i]]$to, tokenizer = tokenizer, ignore = ignore, 
         clean = clean, distance = distance, useBytes = useBytes, weight = weight, maxDist = maxDist, 
         q = q, p = p, nthread = nthread, verbose = verbose, ...)
  6: diff_align(tt1, tt2, tokenizer = tokenizer, ignore = ignore, clean = clean, distance = distance, 
         useBytes = useBytes, weight = weight, maxDist = maxDist, q = q, p = p, nthread = nthread, 
         verbose = verbose, ...)
  7: `[<-`(`*tmp*`, iffer, "type", value = "deletion")
  8: `[<-.data.frame`(`*tmp*`, iffer, "type", value = "deletion")
  9: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 8. Failure: dp_text_base_data works properly (@test_tools.r#25)  ────────────
  `{ ... }` threw an error.
  Message: undefined columns selected
  Class:   simpleError/error/condition
  
  ── 9. Error: dp_text_base_data works properly (@test_tools.r#32)  ──────────────
  replacement has 2 rows, data has 1
  1: expect_true({
         dp$text_add(text = "abcd")
         dim(dp_text_base_data(dp))[1] == 2
     }, NA) at testthat/test_tools.r:32
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: dp_text_base_data(dp) at testthat/test_tools.r:34
  5: `[<-`(`*tmp*`, seq_along(dp$text), names[i], value = NA)
  6: `[<-.data.frame`(`*tmp*`, seq_along(dp$text), names[i], value = NA)
  7: xpdrows.data.frame(x, rows, new.rows)
  8: `[[<-`(`*tmp*`, i, value = c(NA, NA))
  9: `[[<-.data.frame`(`*tmp*`, i, value = c(NA, NA))
  10: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 10. Error: as.data.frame methods work (@test_tools.r#48)  ───────────────────
  replacement has 1 row, data has 0
  1: dp$text_align() at testthat/test_tools.r:48
  2: self$text_align(self$link[[i]]$from, self$link[[i]]$to, tokenizer = tokenizer, ignore = ignore, 
         clean = clean, distance = distance, useBytes = useBytes, weight = weight, maxDist = maxDist, 
         q = q, p = p, nthread = nthread, verbose = verbose, ...)
  3: diff_align(tt1, tt2, tokenizer = tokenizer, ignore = ignore, clean = clean, distance = distance, 
         useBytes = useBytes, weight = weight, maxDist = maxDist, q = q, p = p, nthread = nthread, 
         verbose = verbose, ...)
  4: `[<-`(`*tmp*`, iffer, "type", value = "insertion")
  5: `[<-.data.frame`(`*tmp*`, iffer, "type", value = "insertion")
  6: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 120 SKIPPED: 0 FAILED: 10
  1.  Failure: diff_align works on basic level (@test_diff_align.R#12) 
  2.  Error: diff_align works on basic level (@test_diff_align.R#23) 
  3.  Error: diff_align works on level 2 (@test_diff_align.R#47) 
  4.  Error: diffrproject text_align works (@test_dp_align.r#10) 
  5.  Error: diffrproject alignment_delete works (@test_dp_align.r#87) 
  6.  Error: diffrproject alignment_data_set() (@test_dp_align.r#147) 
  7.  Error: diffrproject alignment_data_code() (@test_dp_align.r#221) 
  8.  Failure: dp_text_base_data works properly (@test_tools.r#25) 
  9.  Error: dp_text_base_data works properly (@test_tools.r#32) 
  10. Error: as.data.frame methods work (@test_tools.r#48) 
  
  Error: testthat unit tests failed
  Execution halted