diff --git a/tests/test_converting_path_for_r_script/Snakefile b/tests/test_converting_path_for_r_script/Snakefile new file mode 100644 index 000000000..c19e776e7 --- /dev/null +++ b/tests/test_converting_path_for_r_script/Snakefile @@ -0,0 +1,18 @@ + +from pathlib import Path + + +rule all: + input: + out_file="out-file.txt" + + +rule step1: + input: + text_file=Path("text-file.txt") + params: + param_dir=Path("dir") + output: + out_file=Path("out-file.txt") + script: + "r-script.R" diff --git a/tests/test_converting_path_for_r_script/expected-results/.github_touch b/tests/test_converting_path_for_r_script/expected-results/.github_touch new file mode 100644 index 000000000..e69de29bb diff --git a/tests/test_converting_path_for_r_script/r-script.R b/tests/test_converting_path_for_r_script/r-script.R new file mode 100644 index 000000000..23ae87960 --- /dev/null +++ b/tests/test_converting_path_for_r_script/r-script.R @@ -0,0 +1,9 @@ + +infile <- snakemake@input[["text_file"]] + +# Check the read value is as expected in R. +param_dir <- snakemake@params[["param_dir"]] +stopifnot(param_dir == "dir") + +outfile <- snakemake@output[["out_file"]] +file.create(outfile) diff --git a/tests/test_converting_path_for_r_script/text-file.txt b/tests/test_converting_path_for_r_script/text-file.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/tests.py b/tests/tests.py index 0fbea1540..a86f06ce6 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -1340,5 +1340,9 @@ def test_github_issue1158(): ) +def test_converting_path_for_r_script(): + run(dpath("test_converting_path_for_r_script"), cores=1) + + def test_ancient_dag(): run(dpath("test_ancient_dag"))