diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-03-05 23:01:52 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-03-05 23:01:52 -0500 |
commit | bdbb9c95d401b62d01fa80c04265bcd27658488a (patch) | |
tree | 5b507b1ba74689d3749f1ef30088ea61a32d01b4 /test-snakemake-mode.el | |
parent | 81a564f0ae6891b73e17a1ae2ef25a13a552e74c (diff) | |
download | snakemake-mode-bdbb9c95d401b62d01fa80c04265bcd27658488a.tar.gz |
Indent field values that start on their own line
Previously, indentation was handled only for the first line following
a run value. Extend this to support any field value that starts on
the line below a field key, since that is valid syntax.
Diffstat (limited to 'test-snakemake-mode.el')
-rw-r--r-- | test-snakemake-mode.el | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/test-snakemake-mode.el b/test-snakemake-mode.el index a3afa7b..51a8a7e 100644 --- a/test-snakemake-mode.el +++ b/test-snakemake-mode.el @@ -120,6 +120,37 @@ rule abc: (snakemake-indent-line) (buffer-string)))) + ;; Below a naked rule field key + (should + (string= + " +rule abc: + output: + " + (snakemake-with-temp-text + " +rule abc: + output: +<point>" + (snakemake-indent-line) + (buffer-string)))) + + ;; Below a naked rule field key, repeated + (should + (string= + " +rule abc: + output: + " + (snakemake-with-temp-text + " +rule abc: + output: +<point>" + (snakemake-indent-line) + (snakemake-indent-line) + (buffer-string)))) + ;; Below a filled rule field key (should (string= @@ -247,6 +278,26 @@ subworkflow otherworkflow: snakefile: '../path/to/otherworkflow/Snakefile'" (should (snakemake-in-rule-or-subworkflow-block-p)))) +(ert-deftest test-snakemake-mode/below-naked-field-p () + "Test `snakemake-below-naked-field-p'." + (snakemake-with-temp-text + " +rule abc: + output: +<point>" + (should (snakemake-below-naked-field-p))) + (snakemake-with-temp-text + " +rule abc: + output: 'file' +<point>" + (should-not (snakemake-below-naked-field-p))) + (snakemake-with-temp-text + " +rule abc: + output: <point>" + (should-not (snakemake-below-naked-field-p)))) + (ert-deftest test-snakemake-mode/run-field-line-p () "Test `snakemake-run-field-line-p'." (snakemake-with-temp-text |