Skip to content

Commit b12cd5c

Browse files
committed
tests : fix buggy and failing test due to errornous tokenizer
1 parent 1df76a5 commit b12cd5c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/testthat/test_rtext.r

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ test_that("rtext load is same as save", {
272272
rtext$new(
273273
text = "1234567890",
274274
text_file = dp_tf("test_utf8.txt"),
275-
tokenizer = function(x){strsplit(x,"\n")},
275+
tokenizer = function(x){text_tokenize(x,"\n", non_token = TRUE)},
276276
encoding = "latin1",
277277
id = "bollocks",
278278
save_file = tempfile()
@@ -366,9 +366,9 @@ test_that("rtext initialization", {
366366
expect_error( rtext$new(), NA)
367367
expect_error( rtext$new(NULL), NA)
368368
expect_error( rtext$new(""), NA)
369-
expect_error( rtext$new(text_file=dp_tf("rc_1.txt")), NA)
370-
expect_error( rtext$new(text="", text_file=dp_tf("rc_1.txt")), NA)
371-
expect_error( rtext$new(text=readLines(dp_tf("rc_1.txt"))), NA)
369+
expect_error( rtext$new(text_file=dp_tf("rc_1_ch1.txt")), NA)
370+
expect_error( rtext$new(text="", text_file=dp_tf("rc_1_ch1.txt")), NA)
371+
expect_error( rtext$new(text=readLines(dp_tf("rc_1_ch1.txt"))), NA)
372372
expect_true({
373373
!is.null(rtext$new("")$id)
374374
})

0 commit comments

Comments
 (0)