changed stopifnot(length == length) to assert_that equivalent