tests/devEqualTypes.R

library("R.devices")
devEqualTypes <- R.devices:::.devEqualTypes
png <- grDevices::png
postscript <- grDevices::postscript

message("*** devEqualTypes() ...")

message("*** devEqualTypes('png', 'png') ...")
res <- devEqualTypes("png", "png")
stopifnot(res)

message("*** devEqualTypes('png', png) ...")
res <- devEqualTypes("png", png)
stopifnot(res)

message("*** devEqualTypes(png, 'png') ...")
res <- devEqualTypes(png, "png")
stopifnot(res)

message("*** devEqualTypes(foo, png) ...")
foo <- png
res <- devEqualTypes(foo, png)
stopifnot(res)

message("*** devEqualTypes('png', postscript) ...")
res <- devEqualTypes("png", postscript)
stopifnot(!res)

message("*** devEqualTypes(postscript, 'png') ...")
res <- devEqualTypes(postscript, "png")
stopifnot(!res)

message("*** devEqualTypes('non-existing', png) ...")
res <- devEqualTypes("non-existing", png)
stopifnot(!res)

message("*** devEqualTypes(png, 'non-existing') ...")
res <- devEqualTypes(png, "non-existing")
stopifnot(!res)

message("*** devEqualTypes(nulldev, 'nulldev') ...")
res <- devEqualTypes(nulldev, "nulldev")
stopifnot(res)

message("*** devEqualTypes() ... DONE")

Try the R.devices package in your browser

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

R.devices documentation built on Oct. 30, 2019, 10:58 a.m.