1
2isWindows <- Sys.info()[["sysname"]] == "Windows"
3if (!isWindows) exit_file("Skipping test on non-Windows platform")
4
5d <- tempfile()
6dir.create(d)
7
8# A file path not representable in latin-1
9f <- file.path(d, "tricky-ő")
10
11# We need to use a binary mode connection so the newlines
12# are consistent across platforms
13con <- file(f, open = "wb")
14writeLines("foobar", con = con)
15close(con)
16
17expect_identical(digest::digest(file = f), "14758f1afd44c09b7992073ccf00b43d")
18
19expect_identical(digest::digest(f, file = TRUE), "14758f1afd44c09b7992073ccf00b43d")
20
21vd <- getVDigest()
22
23expect_identical(vd(file = f), "14758f1afd44c09b7992073ccf00b43d")
24
25expect_identical(vd(f, file = TRUE), "14758f1afd44c09b7992073ccf00b43d")
26
27unlink(d, recursive = TRUE)
28