From 77b26599291f46396646013893471f91203420e9 Mon Sep 17 00:00:00 2001 From: ThePolywolf Date: Thu, 19 Feb 2026 15:29:10 -0700 Subject: [PATCH 1/2] add3 test --- .idea/misc.xml | 9 + .idea/rAvailablePackageCache.xml | 133234 +++++++++++++++ .idea/rGraphicsSettings.xml | 9 + .idea/rSettings.xml | 6 + .idea/rpackages.xml | 10 + .../shelved.patch" | 31 + ...re_Update_at_1_15_26__3_27PM__Changes_.xml | 4 + .idea/vcs.xml | 6 + .idea/workspace.xml | 65 + tests/testthat/test-add3.R | 86 + 10 files changed, 133460 insertions(+) create mode 100644 .idea/misc.xml create mode 100644 .idea/rAvailablePackageCache.xml create mode 100644 .idea/rGraphicsSettings.xml create mode 100644 .idea/rSettings.xml create mode 100644 .idea/rpackages.xml create mode 100644 ".idea/shelf/Uncommitted_changes_before_Update_at_1_15_26,_3_27\342\200\257PM_[Changes]/shelved.patch" create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_1_15_26__3_27PM__Changes_.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 tests/testthat/test-add3.R diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..02b92f8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/rAvailablePackageCache.xml b/.idea/rAvailablePackageCache.xml new file mode 100644 index 0000000..1a07041 --- /dev/null +++ b/.idea/rAvailablePackageCache.xml @@ -0,0 +1,133234 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/rGraphicsSettings.xml b/.idea/rGraphicsSettings.xml new file mode 100644 index 0000000..18334de --- /dev/null +++ b/.idea/rGraphicsSettings.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/.idea/rSettings.xml b/.idea/rSettings.xml new file mode 100644 index 0000000..f6547f5 --- /dev/null +++ b/.idea/rSettings.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/rpackages.xml b/.idea/rpackages.xml new file mode 100644 index 0000000..1709b2d --- /dev/null +++ b/.idea/rpackages.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git "a/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26,_3_27\342\200\257PM_[Changes]/shelved.patch" "b/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26,_3_27\342\200\257PM_[Changes]/shelved.patch" new file mode 100644 index 0000000..a4be24b --- /dev/null +++ "b/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26,_3_27\342\200\257PM_[Changes]/shelved.patch" @@ -0,0 +1,31 @@ +Index: NAMESPACE +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+># Generated by roxygen2: do not edit by hand\n\nexport(add2)\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/NAMESPACE b/NAMESPACE +--- a/NAMESPACE (revision 2620d7efa2aff62b9b90e2ba950a7bce006ada0b) ++++ b/NAMESPACE (date 1768514443675) +@@ -1,3 +1,4 @@ + # Generated by roxygen2: do not edit by hand + + export(add2) ++export(randomOperation) +Index: DESCRIPTION +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>Package: template\nTitle: What the Package Does (One Line, Title Case)\nVersion: 0.0.0.9000\nAuthors@R: \n person(\"First\", \"Last\", , \"first.last@example.com\", role = c(\"aut\", \"cre\"),\n comment = c(ORCID = \"YOUR-ORCID-ID\"))\nDescription: What the package does (one paragraph).\nLicense: `use_mit_license()`, `use_gpl3_license()` or friends to pick a\n license\nEncoding: UTF-8\nRoxygen: list(markdown = TRUE)\nRoxygenNote: 7.2.3\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/DESCRIPTION b/DESCRIPTION +--- a/DESCRIPTION (revision 2620d7efa2aff62b9b90e2ba950a7bce006ada0b) ++++ b/DESCRIPTION (date 1768514443580) +@@ -9,4 +9,4 @@ + license + Encoding: UTF-8 + Roxygen: list(markdown = TRUE) +-RoxygenNote: 7.2.3 ++RoxygenNote: 7.3.3 diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26__3_27PM__Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26__3_27PM__Changes_.xml new file mode 100644 index 0000000..74afc89 --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26__3_27PM__Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..637bdf0 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + { + "associatedIndex": 3 +} + + + + { + "keyToString": { + "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true", + "ModuleVcsDetector.initialDetectionPerformed": "true", + "RunOnceActivity.git.unshallow": "true", + "git-widget-placeholder": "main", + "settings.editor.selected.configurable": "configurable.group.appearance" + } +} + + + + + + + + + + 1721627823889 + + + + + + + + \ No newline at end of file diff --git a/tests/testthat/test-add3.R b/tests/testthat/test-add3.R new file mode 100644 index 0000000..81e6dfe --- /dev/null +++ b/tests/testthat/test-add3.R @@ -0,0 +1,86 @@ +library(testthat) +# library(withr) + +# Testing setup + +setup({ + cat("Running setup for test\n") +}) + +teardown({ + cat("Cleaning up tests\n") +}) + +# test blocks +test_that("add3 workds correctly", { + expect_equal(add3(5, 6, 7), 18) + expect_identical(add3(5, 6, 7), 18) +}) + +test_that("order invariant", { + expect_equal(add3(1, 2, 3), 6) + expect_equal(add3(2, 1, 3), 6) + expect_equal(add3(3, 1, 2), 6) + expect_equal(add3(1, 3, 2), 6) + expect_equal(add3(2, 3, 1), 6) + expect_equal(add3(3, 2, 1), 6) +}) + +test_that("negatives work", { + expect_equal(add3(-1, -2, -3), -6) + expect_equal(add3(-3, 1, 2), 0) +}) + +test_that("zero works", { + expect_equal(add3(0, 0, 1), 1) + expect_equal(add3(1, 0, 0), 1) + expect_equal(add3(1, 0, 0), 1) +}) + +test_that("floats work", { + expect_equal(add3(1.1, 2.2, 3.3), 6.6, tolerance = 1e-8) +}) + +test_that("warning example", { + warn_func <- function() { + warning("This is a warning") + } + + expect_warning(warn_func(), "warning") +}) + +test_that("message example", { + msg_func <- function() { + message("Sample Message") + } + + expect_message(msg_func(), "Message") +}) + +test_that("NA/NULL", { + expect_null(NULL) + expect_true(is.na(NA)) +}) + +test_that("Length check", { + expect_length(1:10, 10) +}) + +test_that("Set comparisons", { + expect_setequal(c(1, 2, 3), c(3, 2, 1)) +}) + +test_that("Skipping tests", { + skip("Test skip demo") + expect_true(FALSE) +}) + +# Custom expects +expect_is_one <- function(object) { + expect_true(object == 1, + info = paste(object, "is not even")) +} + +test_that("Custom expect", { + expect_is_one(1) +}) \ No newline at end of file From 5f47c2ff278483321d144891701a645477d8485e Mon Sep 17 00:00:00 2001 From: ThePolywolf Date: Thu, 19 Feb 2026 15:38:49 -0700 Subject: [PATCH 2/2] Fixed gitignore for .idea --- .gitignore | 1 + .idea/misc.xml | 9 - .idea/rAvailablePackageCache.xml | 133234 --------------- .idea/rGraphicsSettings.xml | 9 - .idea/rSettings.xml | 6 - .idea/rpackages.xml | 10 - .../shelved.patch" | 31 - ...re_Update_at_1_15_26__3_27PM__Changes_.xml | 4 - .idea/vcs.xml | 6 - .idea/workspace.xml | 65 - 10 files changed, 1 insertion(+), 133374 deletions(-) delete mode 100644 .idea/misc.xml delete mode 100644 .idea/rAvailablePackageCache.xml delete mode 100644 .idea/rGraphicsSettings.xml delete mode 100644 .idea/rSettings.xml delete mode 100644 .idea/rpackages.xml delete mode 100644 ".idea/shelf/Uncommitted_changes_before_Update_at_1_15_26,_3_27\342\200\257PM_[Changes]/shelved.patch" delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_1_15_26__3_27PM__Changes_.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.gitignore b/.gitignore index e341424..6b2c815 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .httr-oauth .quarto .DS_Store +../.idea/ \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 02b92f8..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/rAvailablePackageCache.xml b/.idea/rAvailablePackageCache.xml deleted file mode 100644 index 1a07041..0000000 --- a/.idea/rAvailablePackageCache.xml +++ /dev/null @@ -1,133234 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/rGraphicsSettings.xml b/.idea/rGraphicsSettings.xml deleted file mode 100644 index 18334de..0000000 --- a/.idea/rGraphicsSettings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/rSettings.xml b/.idea/rSettings.xml deleted file mode 100644 index f6547f5..0000000 --- a/.idea/rSettings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/rpackages.xml b/.idea/rpackages.xml deleted file mode 100644 index 1709b2d..0000000 --- a/.idea/rpackages.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git "a/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26,_3_27\342\200\257PM_[Changes]/shelved.patch" "b/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26,_3_27\342\200\257PM_[Changes]/shelved.patch" deleted file mode 100644 index a4be24b..0000000 --- "a/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26,_3_27\342\200\257PM_[Changes]/shelved.patch" +++ /dev/null @@ -1,31 +0,0 @@ -Index: NAMESPACE -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP -<+># Generated by roxygen2: do not edit by hand\n\nexport(add2)\n -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/NAMESPACE b/NAMESPACE ---- a/NAMESPACE (revision 2620d7efa2aff62b9b90e2ba950a7bce006ada0b) -+++ b/NAMESPACE (date 1768514443675) -@@ -1,3 +1,4 @@ - # Generated by roxygen2: do not edit by hand - - export(add2) -+export(randomOperation) -Index: DESCRIPTION -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP -<+>Package: template\nTitle: What the Package Does (One Line, Title Case)\nVersion: 0.0.0.9000\nAuthors@R: \n person(\"First\", \"Last\", , \"first.last@example.com\", role = c(\"aut\", \"cre\"),\n comment = c(ORCID = \"YOUR-ORCID-ID\"))\nDescription: What the package does (one paragraph).\nLicense: `use_mit_license()`, `use_gpl3_license()` or friends to pick a\n license\nEncoding: UTF-8\nRoxygen: list(markdown = TRUE)\nRoxygenNote: 7.2.3\n -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/DESCRIPTION b/DESCRIPTION ---- a/DESCRIPTION (revision 2620d7efa2aff62b9b90e2ba950a7bce006ada0b) -+++ b/DESCRIPTION (date 1768514443580) -@@ -9,4 +9,4 @@ - license - Encoding: UTF-8 - Roxygen: list(markdown = TRUE) --RoxygenNote: 7.2.3 -+RoxygenNote: 7.3.3 diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26__3_27PM__Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26__3_27PM__Changes_.xml deleted file mode 100644 index 74afc89..0000000 --- a/.idea/shelf/Uncommitted_changes_before_Update_at_1_15_26__3_27PM__Changes_.xml +++ /dev/null @@ -1,4 +0,0 @@ - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 637bdf0..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - { - "associatedIndex": 3 -} - - - - { - "keyToString": { - "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true", - "ModuleVcsDetector.initialDetectionPerformed": "true", - "RunOnceActivity.git.unshallow": "true", - "git-widget-placeholder": "main", - "settings.editor.selected.configurable": "configurable.group.appearance" - } -} - - - - - - - - - - 1721627823889 - - - - - - - - \ No newline at end of file