Skip to content

Commit

Permalink
Use 2L instead of as.integer(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwillem committed Dec 20, 2024
1 parent 7f043c9 commit 2388d5b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/test-matrix.r
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,8 @@ test_that("Symmetric contact matrices with large normalisation weights throw a w
})

test_that("Contacts with an age below the age limits are excluded regardless of the missing.contact.age setting", {
expect_identical(ncol(contact_matrix(polymod, age.limits = c(10, 50), missing.contact.age = "remove")$matrix), as.integer(2))
expect_identical(ncol(contact_matrix(polymod, age.limits = c(10, 50), missing.contact.age = "sample")$matrix), as.integer(2))
expect_identical(ncol(contact_matrix(polymod, age.limits = c(10, 50), missing.contact.age = "keep")$matrix), as.integer(3)) # extra column for ages outside age limits (= NA)
expect_identical(ncol(contact_matrix(polymod, age.limits = c(10, 50), missing.contact.age = "ignore")$matrix), as.integer(2))
expect_identical(ncol(contact_matrix(polymod, age.limits = c(10, 50), missing.contact.age = "remove")$matrix), 2L)
expect_identical(ncol(contact_matrix(polymod, age.limits = c(10, 50), missing.contact.age = "sample")$matrix), 2L)
expect_identical(ncol(contact_matrix(polymod, age.limits = c(10, 50), missing.contact.age = "keep")$matrix), 2L) # extra column for ages outside age limits (= NA)
expect_identical(ncol(contact_matrix(polymod, age.limits = c(10, 50), missing.contact.age = "ignore")$matrix), 2L)
})

0 comments on commit 2388d5b

Please sign in to comment.