## autogenerated unit-test ## from codegen/generate_unit-tests.sh ## the file will be overwritten in the next iteration ## ## author: Serkan Korkmaz ## test that the function runs without ## any conditions testthat::test_that(desc = 'Runs without *any* conditions', code = { output <- testthat::expect_no_condition( { rolling_variance( x = SPY[, 1] ) } ) }) ## test that the length of the input ## matches the output testthat::test_that(desc = 'Length in, length out', code = { testthat::expect_equal( object = length( rolling_variance( x = SPY[, 1] ) ), expected = length(SPY[, 1]) ) }) ## test that the output is a vector testthat::test_that(desc = 'Output type', code = { output <- rolling_variance( x = SPY[, 1] ) testthat::expect_true( typeof(output) == "double" ) testthat::expect_true( is.vector(output) ) })