diff --git a/DESCRIPTION b/DESCRIPTION index d3d3c50..3f9aac0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: kanjistat Type: Package Title: A Statistical Framework for the Analysis of Japanese Kanji Characters -Version: 0.14.0 -Date: 2024-05-29 +Version: 0.14.1 +Date: 2024-05-30 Authors@R: c( person("Dominic", "Schuhmacher", email = "dominic.schuhmacher@mathematik.uni-goettingen.de", role = c("aut","cre"), comment = c(ORCID = "0000-0001-7079-6313")), person("Lennart", "Finke", email = "l.finke@stud.uni-goettingen.de", role = "aut", comment = c(ORCID = "0009-0003-6908-314X")) ) Maintainer: Dominic Schuhmacher diff --git a/NEWS.md b/NEWS.md index ece6bc9..6add554 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# kanjistat 0.14.1 (2024-05-30) + +## Bug fixes + +* Some unit tests were performed conditionally on the availability of package spatstat.data rather than kanjistat.data, which led to errors in the CRAN checks whenever spatstat.data was available but kanjistat.data was not. Fixed. + +------------------------------- + # kanjistat 0.14.0 (2024-05-29) ## New features diff --git a/tests/testthat/test-kanji1.R b/tests/testthat/test-kanji1.R index e32bfd8..685e48d 100644 --- a/tests/testthat/test-kanji1.R +++ b/tests/testthat/test-kanji1.R @@ -34,7 +34,7 @@ test_that("convert_kanji, single entry, simplify", { expect_equal( convert_kanji(list(kanjivec_ref_fuji), "index"), 1032 ) expect_equal( convert_kanji(list(kanjivec_ref_fuji), "character"), "藤" ) expect_equal( convert_kanji(list(kanjivec_ref_fuji), "hexmode"), as.hexmode("85e4") ) - skip_if_not_installed("spatstat.data") + skip_if_not_installed("kanjistat.data") # output = "all" expect_equal( convert_kanji("藤"), list(index=1032, character="藤", hexmode=as.hexmode("85e4"), kanjivec=kanjivec_ref_fuji), @@ -87,7 +87,7 @@ test_that("convert_kanji, multiple entries, simplify", { expect_equal( convert_kanji(list(kanjivec_ref_fuji, kanjivec_ref_fuji), "index"), c(1032, 1032) ) expect_equal( convert_kanji(list(kanjivec_ref_fuji, kanjivec_ref_fuji), "character"), c("藤", "藤") ) expect_equal( convert_kanji(list(kanjivec_ref_fuji, kanjivec_ref_fuji), "hexmode"), as.hexmode(c("85e4", "85e4")) ) - skip_if_not_installed("spatstat.data") + skip_if_not_installed("kanjistat.data") # output = "all" sublist <- list(index=1032, character="藤", hexmode=as.hexmode("85e4"), kanjivec=kanjivec_ref_fuji) expect_equal( convert_kanji(c("藤","藤")), list(sublist, sublist), @@ -144,12 +144,12 @@ test_that("convert_kanji, single entry, don't simplify", { expect_equal( convert_kanji(list(kanjivec_ref_fuji), "index", simplify=FALSE), list(1032) ) expect_equal( convert_kanji(list(kanjivec_ref_fuji), "character", simplify=FALSE), list("藤") ) expect_equal( convert_kanji(list(kanjivec_ref_fuji), "hexmode", simplify=FALSE), list(as.hexmode("85e4")) ) - skip_if_not_installed("spatstat.data") + skip_if_not_installed("kanjistat.data") # output = "all" expect_equal( convert_kanji(list("藤"), simplify=FALSE)[[1]], list(index=1032, character="藤", hexmode=as.hexmode("85e4"), kanjivec=kanjivec_ref_fuji), - ignore_attr=c("call", "kanjistat_version") ) + ignore_attr=c("call", "kanjistat_version") ) # test only the first one also *without* list expect_equal( convert_kanji(1032, "kanjivec", simplify=FALSE), kanjivec_ref_fuji, ignore_attr=c("call", "kanjistat_version") ) @@ -198,7 +198,7 @@ test_that("convert_kanji, multiple entries, don't simplify", { expect_equal( convert_kanji(list(kanjivec_ref_fuji, kanjivec_ref_fuji), "index", simplify=FALSE), list(1032, 1032) ) expect_equal( convert_kanji(list(kanjivec_ref_fuji, kanjivec_ref_fuji), "character", simplify=FALSE), list("藤", "藤") ) expect_equal( convert_kanji(list(kanjivec_ref_fuji, kanjivec_ref_fuji), "hexmode", simplify=FALSE), list(as.hexmode("85e4"), as.hexmode("85e4")) ) - skip_if_not_installed("spatstat.data") + skip_if_not_installed("kanjistat.data") # output = "all" sublist <- list(index=1032, character="藤", hexmode=as.hexmode("85e4"), kanjivec=kanjivec_ref_fuji) expect_equal( convert_kanji(list("藤","藤"), simplify=FALSE), list(sublist, sublist), diff --git a/tests/testthat/test-stroke_edit_distance.R b/tests/testthat/test-stroke_edit_distance.R index 2482f92..9f9111f 100644 --- a/tests/testthat/test-stroke_edit_distance.R +++ b/tests/testthat/test-stroke_edit_distance.R @@ -1,7 +1,7 @@ # contains indirectly also tests for values of dstrokedit test_that("sedist, same as Yencken, type does not matter", { - skip_if_not_installed("spatstat.data") + skip_if_not_installed("kanjistat.data") ind1 <- 384L ind2 <- c(93L, 413L, 786L, 895L, 1020L, 1137L, 1282L, 1359L, 1433L, 1642L, 1959L) res <- sedist(ind1, ind2) @@ -30,7 +30,7 @@ test_that("sedist, different from Yencken, type does matter", { 0.5, 0.44444444444444442) # sedist first expect_equal(dstrokedit[ind1,ind2], expected0) # - skip_if_not_installed("spatstat.data") + skip_if_not_installed("kanjistat.data") expect_equal( as.vector(sedist(ind1, ind2, type="full")), expected1) expect_equal( as.vector(sedist(ind1, ind2, type="before_slash")), expected1) expect_equal( as.vector(sedist(ind1, ind2, type="first")), expected2)