tests/testthat/test-wang13.R

context("test-wang13")

test_that("from legacy implementation", {
  # C major
  expect_equal(
    roughness_wang(c(48, 64, 67)),
    0.67,
    tolerance = 1e-2
  )
  expect_equal(
    roughness_wang(c(48, 64, 67), include_phase_impact_factors = TRUE),
    0.11,
    tolerance = 1e-2
  )

  # C dim
  expect_equal(
    roughness_wang(c(48, 63, 66)),
    0.82,
    tolerance = 1e-2
  )
  expect_equal(
    roughness_wang(c(48, 63, 66), include_phase_impact_factors = TRUE),
    0.10,
    tolerance = 1e-2
  )
})
pmcharrison/wang13 documentation built on June 14, 2019, 11:08 p.m.