tests/testthat/test-1-construct-line-.R

test_that("rests can be represented by `NULL`, `NA`, and empty vectors", {
  pitches <- list(
    NULL,
    NA, NA_real_, NA_integer_, NA_character_,
    logical(), double(), integer(), character()
  )

  out <- Line(pitches)$notes$pitch
  expected <- rep(NA_character_, length(pitches))
  expect_identical(out, expected)
})

Try the gm package in your browser

Any scripts or data that you put into this service are public.

gm documentation built on Sept. 11, 2024, 6:11 p.m.