summaryrefslogtreecommitdiff
path: root/snakemake-test.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-04-17 18:26:30 -0400
committerKyle Meyer <kyle@kyleam.com>2016-04-17 19:05:03 -0400
commit2682860608862b99adbe830c289efe9897700fc1 (patch)
tree10e9b377bceee2494e546c4f71ef6db32ca839fa /snakemake-test.el
parent5c5a31aacb0e6c79646b316b7e6c02f68f7c7912 (diff)
downloadsnakemake-mode-2682860608862b99adbe830c289efe9897700fc1.tar.gz
snakemake-rule-at-point: Fix anonymous rule check
Diffstat (limited to 'snakemake-test.el')
-rw-r--r--snakemake-test.el20
1 files changed, 16 insertions, 4 deletions
diff --git a/snakemake-test.el b/snakemake-test.el
index eeb2e5f..274ce56 100644
--- a/snakemake-test.el
+++ b/snakemake-test.el
@@ -80,6 +80,11 @@ rule cc_wildcards:
rule dd_subdir:
input: \"aa.out\"
output: \"subdir/dd.out\"
+ shell: \"cat {input} > {output}\"
+
+rule:
+ input: \"anon.in\"
+ output: \"anon.out\"
shell: \"cat {input} > {output}\""))
,@body)
(delete-directory snakemake-test-dir t)))))
@@ -710,13 +715,13 @@ rule abc:
(ert-deftest snakemake-test-rule-targets ()
(should
- (equal '("aa" "bb" "dd_subdir")
+ (equal '("aa" "bb" "dd_subdir" "5")
(snakemake-with-temp-dir
(snakemake-rule-targets)))))
(ert-deftest snakemake-test-all-rules ()
(should
- (equal '("aa" "bb" "cc_wildcards" "dd_subdir")
+ (equal '("aa" "bb" "cc_wildcards" "dd_subdir" "5")
(snakemake-with-temp-dir
(snakemake-all-rules)))))
@@ -724,7 +729,7 @@ rule abc:
(should
(equal
(and snakemake-file-target-program
- '("aa.out" "bb.out" "subdir/dd.out"))
+ '("aa.out" "bb.out" "subdir/dd.out" "anon.out"))
(snakemake-with-temp-dir
(snakemake-file-targets)))))
@@ -809,7 +814,14 @@ rule abc:
(snakemake-mode)
(insert-file-contents "Snakefile")
(re-search-forward "rule cc_wildcards:")
- (snakemake-rule-at-point 'target)))))
+ (snakemake-rule-at-point 'target))))
+ (should-not
+ (snakemake-with-temp-dir
+ (with-temp-buffer
+ (snakemake-mode)
+ (insert-file-contents "Snakefile")
+ (re-search-forward "rule:")
+ (snakemake-rule-at-point)))))
(provide 'snakemake-test)
;;; snakemake-test.el ends here