Skip to content

Commit

Permalink
resolved typos in tests and hanging assignment copy-paste errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismainey committed Dec 14, 2023
1 parent 587654a commit 440a26b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
6 changes: 2 additions & 4 deletions tests/testthat/test-average_wait.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
# })

test_that("it returns an expected result with fixed single values, against arithmetic", {
target_wait <-
em <- "average_wait(): aritmetic error with single value inputs."
em <- "average_wait(): arithmetic error with single value inputs."
expect_equal(average_wait(52, 4), 52/4)
})

test_that("it returns an expected result with fixed single values", {
target_wait <-
em <- "average_wait(): aritmetic error with single value inputs."
em <- "average_wait(): arithmetic error with single value inputs."
expect_equal(average_wait(52, 4), 13)
})

Expand Down
7 changes: 3 additions & 4 deletions tests/testthat/test-queue_load.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@
# })

test_that("it returns an expected result with fixed single values, against arithmetic", {
em <- "queue_load(): aritmetic error with single value inputs."
em <- "queue_load(): arithmetic error with single value inputs."
expect_equal(queue_load(30, 27), 30/27)
})

test_that("it returns an expected result with fixed single values", {
queue_load <-
em <- "queue_load(): aritmetic error with single value inputs."
em <- "queue_load(): arithmetic error with single value inputs."
expect_equal(queue_load(30, 27), 1.11111111)
})


test_that("it returns an expected result with vector of fixed values", {
em <- "queue_load(): aritmetic error with vector of values as inputs."
em <- "queue_load(): arithmetic error with vector of values as inputs."
expect_equal(
queue_load(
c(35, 30, 52),
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-relief_capacity.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
#'

test_that("it returns an expected result with fixed single values, against arithmetic", {
em <- "relief_capacity(): aritmetic error with single value inputs."
em <- "relief_capacity(): arithmetic error with single value inputs."
expect_equal(relief_capacity(30, 1200, 390, 26), 30 + (1200 - 390)/26)
})

test_that("it returns an expected result with fixed single values", {
em <- "relief_capacity(): aritmetic error with single value inputs."
em <- "relief_capacity(): arithmetic error with single value inputs."
expect_equal(relief_capacity(30, 1200, 390, 26), 61.153846)
})

test_that("it returns an expected result with vector of fixed values", {
em <- "relief_capacity(): aritmetic error with vector of input values."
em <- "relief_capacity(): arithmetic error with vector of input values."
expect_equal(
relief_capacity(
c(30, 33, 35 ),
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-target_capacity.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
# })

test_that("it returns an expected result with fixed single values, against arithmetic", {
em <- "target_capacity(): aritmetic error with single value inputs."
em <- "target_capacity(): arithmetic error with single value inputs."
expect_equal(target_capacity(30,52,3), 30 + 2*(1+4*3)/52)
})

test_that("it returns an expected result with fixed single values", {
em <- "target_capacity(): aritmetic error with single value inputs."
em <- "target_capacity(): arithmetic error with single value inputs."
expect_equal(target_capacity(30,52,3), 30.5)
})

test_that("it returns an expected result with vector of fixed values", {
em <- "target_capacity(): aritmetic error with vector of input values."
em <- "target_capacity(): arithmetic error with vector of input values."
expect_equal(
target_capacity(
c(30, 42, 35 ),
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-target_queue_size.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@


test_that("it returns an expected result with fixed single values", {
em <- "target_queue_size(): aritmetic error with single value inputs."
em <- "target_queue_size(): arithmetic error with single value inputs."
expect_equal(target_queue_size(30, 52), 390)
expect_equal(target_queue_size(30, 50), 375)
expect_equal(target_queue_size(30, 50, 6), 250)
})

test_that("it returns an expected result with vector of fixed values", {
em <- "target_queue_size(): aritmetic error with vector of values as inputs."
em <- "target_queue_size(): arithmetic error with vector of values as inputs."
expect_equal(
target_queue_size(
c(30, 30, 30 ),
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-waiting_list_pressure.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
# })

test_that("it returns an expected result with fixed single values, against arithmetic", {
em <- "waiting_list_pressure(): aritmetic error with single value inputs."
em <- "waiting_list_pressure(): arithmetic error with single value inputs."
expect_equal(waiting_list_pressure(63, 52), 2 * 63 / 52)
})

test_that("it returns an expected result with fixed single values", {
em <- "waiting_list_pressure(): aritmetic error with single value inputs."
em <- "waiting_list_pressure(): arithmetic error with single value inputs."
expect_equal(waiting_list_pressure(63, 52), 2.42307692)
})

test_that("it returns an expected result with vector of fixed values", {
em <- "waiting_list_pressure(): aritmetic error with vector of input values."
em <- "waiting_list_pressure(): arithmetic error with vector of input values."
expect_equal(
waiting_list_pressure(
c(63, 42, 55 ),
Expand Down

0 comments on commit 440a26b

Please sign in to comment.