Skip to content

Commit

Permalink
Test duty cycle validator.
Browse files Browse the repository at this point in the history
  • Loading branch information
edwbaker committed Nov 6, 2018
1 parent eb13aac commit c4995d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/testthat/test-validationFunctions.R
Expand Up @@ -70,4 +70,9 @@ test_that("validateDutyCycle inputs", {
expect_error(validateDutyCycle("string"), "Duty cycle must be numeric.")
})

test_that("validateDutyCycle rejects out of range values")
test_that("validateDutyCycle rejects out of range values", {
expect_error(validateDutyCycle(2), "Duty cycle must be less than or equal to one.")
expect_error(validateDutyCycle(-1), "Duty cycle must be greater than or equal to zero.")
expect_equal(validateDutyCycle(0), 0)
expect_equal(validateDutyCycle(1), 1)
})

0 comments on commit c4995d2

Please sign in to comment.