diff --git a/tests/testthat/test_cwb_encode.R b/tests/testthat/test_cwb_encode.R index 27ff910..5258163 100644 --- a/tests/testthat/test_cwb_encode.R +++ b/tests/testthat/test_cwb_encode.R @@ -33,33 +33,45 @@ test_that( ) for (p_attr in c("word", "pos", "lemma")){ - cwb_makeall(corpus = "BT", p_attribute = p_attr, registry = get_tmp_registry()) - cwb_huffcode(corpus = "BT", p_attribute = p_attr, registry = get_tmp_registry()) - cwb_compress_rdx(corpus = "BT", p_attribute = p_attr, registry = get_tmp_registry()) + cwb_makeall(corpus = "BT", p_attribute = p_attr, registry = regdir) + if (.Platform$OS.type != "windows"){ + cwb_huffcode(corpus = "BT", p_attribute = p_attr, registry = regdir) + cwb_compress_rdx(corpus = "BT", p_attribute = p_attr, registry = regdir) + } } - expect_true(cl_load_corpus(corpus = "BT", registry = get_tmp_registry())) + expect_true(cl_load_corpus(corpus = "BT", registry = regdir)) expect_true(tolower("BT") %in% cl_list_corpora()) # In the CQP context, corpus IDs are uppered - here we knowingly provide # a lowercase ID that is uppered internally #64 - expect_true(cqp_load_corpus(corpus = "bt", registry = get_tmp_registry())) + expect_true(cqp_load_corpus(corpus = "bt", registry = regdir)) expect_true("BT" %in% cqp_list_corpora()) for (p_attr in c("word", "pos", "lemma")){ expect_equal( - cl_attribute_size(corpus = "BT", attribute = p_attr, attribute_type = "p", registry = get_tmp_registry()), + cl_attribute_size( + corpus = "BT", + attribute = p_attr, + attribute_type = "p", + registry = regdir + ), 8402 ) } - n <- cl_attribute_size(corpus = "BT", attribute = "word", attribute_type = "p", registry = get_tmp_registry()) + n <- cl_attribute_size( + corpus = "BT", + attribute = "word", + attribute_type = "p", + registry = regdir + ) ids <- cl_cpos2id( - "BT", p_attribute = "word", registry = get_tmp_registry(), + "BT", p_attribute = "word", registry = regdir, cpos = 0L:(n-1L) ) - words <- cl_id2str("BT", p_attribute = "word", registry = get_tmp_registry(), id = ids) + words <- cl_id2str("BT", p_attribute = "word", registry = regdir, id = ids) expect_equal(table(words == "Liebe")[["TRUE"]], 6) expect_equal(table(words == "SPD")[["TRUE"]], 31)