diff --git a/DESCRIPTION b/DESCRIPTION
index ef9057c..202f945 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -21,6 +21,7 @@ BugReports: https://github.com/patperry/r-utf8/issues
Depends:
R (>= 2.10)
Suggests:
+ asciicast,
cli,
covr,
knitr,
diff --git a/tests/testthat/_snaps/utf8_print/asciicast_7d79bf19352fcff29e0e9427c70147c6.svg b/tests/testthat/_snaps/utf8_print/asciicast_7d79bf19352fcff29e0e9427c70147c6.svg
new file mode 100644
index 0000000..0740ec9
--- /dev/null
+++ b/tests/testthat/_snaps/utf8_print/asciicast_7d79bf19352fcff29e0e9427c70147c6.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/testthat/_snaps/utf8_print/chartype-c.svg b/tests/testthat/_snaps/utf8_print/chartype-c.svg
new file mode 100644
index 0000000..78a73d6
--- /dev/null
+++ b/tests/testthat/_snaps/utf8_print/chartype-c.svg
@@ -0,0 +1 @@
+2"\a\b\f\n\r\t""Namedcontrolcode"3"abcdefuvwxyz""ASCII"4"\u0080\u009f""C1controlcode"5" ¡¢£¤¥úûüýþÿ""Latin-1"6"ĀāĂ㥹ĆćĈĉĊċ""Unicode"7"!"#$%&""Unicodewide"8"\u0e00\u2029""Unicodecontrol"9"xxxxxxxxxxxx""Unicodeignorable"10"àáâãāa̅ăȧäảåa̋""Unicodemark"11"😀😁😂😃😄💃""Emoji"12"x\U0010ffffx""Unassigned"13"\xfd\xfe\xff""Invalid"
\ No newline at end of file
diff --git a/tests/testthat/_snaps/utf8_print/chartype.svg b/tests/testthat/_snaps/utf8_print/chartype.svg
new file mode 100644
index 0000000..78a73d6
--- /dev/null
+++ b/tests/testthat/_snaps/utf8_print/chartype.svg
@@ -0,0 +1 @@
+2"\a\b\f\n\r\t""Namedcontrolcode"3"abcdefuvwxyz""ASCII"4"\u0080\u009f""C1controlcode"5" ¡¢£¤¥úûüýþÿ""Latin-1"6"ĀāĂ㥹ĆćĈĉĊċ""Unicode"7"!"#$%&""Unicodewide"8"\u0e00\u2029""Unicodecontrol"9"xxxxxxxxxxxx""Unicodeignorable"10"àáâãāa̅ăȧäảåa̋""Unicodemark"11"😀😁😂😃😄💃""Emoji"12"x\U0010ffffx""Unassigned"13"\xfd\xfe\xff""Invalid"
\ No newline at end of file
diff --git a/tests/testthat/test-utf8_print.R b/tests/testthat/test-utf8_print.R
index c531fff..a384a48 100644
--- a/tests/testthat/test-utf8_print.R
+++ b/tests/testthat/test-utf8_print.R
@@ -14,6 +14,9 @@ test_that("'utf8_print' can print unicode", {
"\"\u0106\u0107\u0108\u0109\u010a\u010b\""
)
)
+
+ skip_if_not_installed("asciicast", "2.3.1.9000")
+ asciicast::expect_snapshot_cast(utf8_print(x))
})
test_that("'utf8_print' works with unnamed character vectors", {
@@ -446,6 +449,9 @@ test_that("'utf8_print' handles Unicode correctly", {
Encoding(expected) <- "UTF-8"
expect_equal(actual, expected)
+
+ skip_if_not_installed("asciicast", "2.3.1.9000")
+ asciicast::expect_snapshot_cast(utf8_print(x), name = "chartype.svg")
})
@@ -495,4 +501,7 @@ test_that("'utf8_print' works in C locale", {
)
expect_equal(actual, expected)
+
+ skip_if_not_installed("asciicast", "2.3.1.9000")
+ asciicast::expect_snapshot_cast(utf8_print(x), name = "chartype-c.svg")
})