# x <- c(1L, 2L, 3L)
# y <- c(4L, 5L, 6L)
# z <- peptr_ptm2(x, y, "ptm2_test")
#
# test_that("new_ptm2 works", {
# expect_equal(vctrs::vec_size(new_ptm2()), 0)
# expect_equal(class(new_ptm2()), c("peptr_ptm2", "vctrs_rcrd", "vctrs_vctr"))
# expect_equal(vctrs::vec_size(new_ptm2(peptr_position(x), peptr_position(y))), 3)
# })
#
# test_that("peptr_ptm works", {
# expect_equal(vctrs::vec_size(peptr_ptm2()), 0)
# expect_equal(class(peptr_ptm2()), c("peptr_ptm2", "vctrs_rcrd", "vctrs_vctr"))
# expect_equal(
# class(z),
# c("peptr_ptm2", "vctrs_rcrd", "vctrs_vctr")
# )
# expect_equal(
# class(peptr_ptm2(as.numeric(x), as.numeric(y))),
# c("peptr_ptm2", "vctrs_rcrd", "vctrs_vctr")
# )
# expect_true(peptr_is_ptm2(z))
# expect_false(peptr_is_ptm2(x))
# expect_false(peptr_is_ptm2(y))
# expect_true(is.na(peptr_ptm2(NA, NA)))
# # expect_equal(is.na(peptr_ptm(c(1, 3, NA))), c(FALSE, FALSE, TRUE))
# expect_equal(vctrs::field(z, "position_1"), peptr_position(x))
# expect_equal(vctrs::field(z, "position_2"), peptr_position(y))
# expect_equal(peptr_get_ptm2_name(z), "ptm2_test")
# expect_equal(peptr_get_ptm2_name(peptr_ptm2(x, y)), "unknown")
# })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.