new tests are commented out. spells trouble on different platforms.

This commit is contained in:
Andreas Gammelgaard Damsbo 2023-06-05 11:21:44 +02:00
parent ece04f9948
commit 2006959f57

View File

@ -14,47 +14,47 @@ test_that("contrast_text() returns the correct text color", {
################################################################################
library(devtools)
install_github("MangoTheCat/visualTest")
library(visualTest)
test_that("New test of color_plot()", {
par(bg=NULL)
colors <- colors()[34:53]
# old <- getwd()
# setwd("/Users/au301842/stRoke/tests/testthat")
# setwd(old)
png(filename = "data/test1.png")
color_plot(colors,method="relative")
dev.off()
# getFingerprint("data/test1.png")
expect_equal(getFingerprint("data/test1.png"), "AD07D27813E1D867")
# isSimilar(tmp, "AD07D27813E1D867", threshold = 8)
#############################
# colors <- colors()[51:70]
png(filename = "data/test2.png")
color_plot(colors,labels = TRUE, borders = FALSE,cex_label = .5, ncol = 3, method="perceived_2")
dev.off()
# getFingerprint("data/test2.png")
expect_equal(getFingerprint("data/test2.png"), "8B0B54D4E4AF2BB1")
#############################
png(filename = "data/test3.png")
color_plot(colors,labels = FALSE, borders = TRUE, ncol = 6, method="perceived")
dev.off()
# getFingerprint("data/test3.png")
expect_equal(getFingerprint("data/test3.png"), "B706F0F1C119CCF8")
})
# library(devtools)
#
# install_github("MangoTheCat/visualTest")
# library(visualTest)
#
# test_that("New test of color_plot()", {
# par(bg=NULL)
# colors <- colors()[34:53]
#
# # old <- getwd()
# # setwd("/Users/au301842/stRoke/tests/testthat")
# # setwd(old)
#
# png(filename = "data/test1.png")
# color_plot(colors,method="relative")
# dev.off()
#
# # getFingerprint("data/test1.png")
#
# expect_equal(getFingerprint("data/test1.png"), "AD07D27813E1D867")
# # isSimilar(tmp, "AD07D27813E1D867", threshold = 8)
#
# #############################
#
# # colors <- colors()[51:70]
# png(filename = "data/test2.png")
# color_plot(colors,labels = TRUE, borders = FALSE,cex_label = .5, ncol = 3, method="perceived_2")
# dev.off()
#
# # getFingerprint("data/test2.png")
#
# expect_equal(getFingerprint("data/test2.png"), "8B0B54D4E4AF2BB1")
#
# #############################
#
# png(filename = "data/test3.png")
# color_plot(colors,labels = FALSE, borders = TRUE, ncol = 6, method="perceived")
# dev.off()
#
# # getFingerprint("data/test3.png")
#
# expect_equal(getFingerprint("data/test3.png"), "B706F0F1C119CCF8")
# })
################################################################################