From 617b79fb3e0707b9bd0b446db73a2b1d7f6f3f94 Mon Sep 17 00:00:00 2001 From: Chris Sobczak Date: Wed, 10 Jun 2026 15:58:27 -0700 Subject: Add corplot --- tests/testthat.R | 12 ++++++++++++ tests/testthat/test-corplot.R | 5 +++++ tests/testthat/test-gg_csobczak.R | 7 +++++++ 3 files changed, 24 insertions(+) create mode 100644 tests/testthat.R create mode 100644 tests/testthat/test-corplot.R create mode 100644 tests/testthat/test-gg_csobczak.R (limited to 'tests') diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 0000000..c015e8f --- /dev/null +++ b/tests/testthat.R @@ -0,0 +1,12 @@ +# This file is part of the standard setup for testthat. +# It is recommended that you do not modify it. +# +# Where should you do additional test configuration? +# Learn more about the roles of various files in: +# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview +# * https://testthat.r-lib.org/articles/special-files.html + +library(testthat) +library(rcsobczak) + +test_check("rcsobczak") diff --git a/tests/testthat/test-corplot.R b/tests/testthat/test-corplot.R new file mode 100644 index 0000000..2aecdc1 --- /dev/null +++ b/tests/testthat/test-corplot.R @@ -0,0 +1,5 @@ +test_that("returns a ggplot object", { + x <- matrix(data = rnorm(100), nrow = 10) + p <- corplot(x) + inherits(p, 'ggplot') +}) diff --git a/tests/testthat/test-gg_csobczak.R b/tests/testthat/test-gg_csobczak.R new file mode 100644 index 0000000..ca99bef --- /dev/null +++ b/tests/testthat/test-gg_csobczak.R @@ -0,0 +1,7 @@ +test_that("returns a ggplot object", { + df <- data.frame(x = rnorm(10), y = rnorm(10)) + p <- ggplot2::ggplot(data = df, ggplot2::aes(x = x, y = y)) + + ggplot2::geom_point() + p <- gg_csobczak(p) + inherits(p, 'ggplot') +}) -- cgit v1.2.3