Skip to content

Commit

Permalink
Add testing for sas_run_*
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanzomorrodi committed Nov 18, 2024
1 parent edb9fa4 commit 7e7d66b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/testthat/test-run.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
test_that("Run SAS code from string", {
sas_connect()

expect_s3_class(sas_run_string("PROC MEANS DATA = sashelp.cars;\nRUN;"), "sas_widget")

sas_disconnect()
})

test_that("Run SAS code from file", {
local_path <- "test.sas"
cat("PROC MEANS DATA = sashelp.cars;\nRUN;", file = local_path)

sas_connect()
expect_s3_class(sas_run_file(local_path), "sas_widget")

sas_disconnect()
file.remove(local_path)
})
2 changes: 2 additions & 0 deletions tests/testthat/test.sas
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PROC MEANS DATA = sashelp.cars;
RUN;

0 comments on commit 7e7d66b

Please sign in to comment.