tests/testthat/test-snapshot.R

test_that("the data extracted from font file are as expected", {
  expect_snapshot(string2path("A", "./font/test.ttf"))
  expect_snapshot(string2stroke("A", "./font/test.ttf"))
  expect_snapshot(string2fill("A", "./font/test.ttf"))
})

test_that("the data extracted from installed font are as expected", {
  skip_if_not(isTRUE("Arial" %in% dump_fontdb()$family))

  expect_snapshot(string2path("A", "Arial"))
  expect_snapshot(string2stroke("A", "Arial"))
  expect_snapshot(string2fill("A", "Arial"))
})

Try the string2path package in your browser

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

string2path documentation built on Sept. 12, 2024, 9:35 a.m.