## 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_beta(
				x = SPY[, 1],
				y = SPY[, 2]
			)
		}
	)
})

## 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_beta(
				x = SPY[, 1],
				y = SPY[, 2]
			)
		),
		expected = length(SPY[, 1])
	)
})

## test that the output is a <double> vector
testthat::test_that(desc = 'Output type', code = {
	output <- rolling_beta(
		x = SPY[, 1],
		y = SPY[, 2]
	)

	testthat::expect_true(
		typeof(output) == "double"
	)

	testthat::expect_true(
		is.vector(output)
	)
})
