From 97b008e65f0402388cfacd32aee3b4dd4fbaf2ff Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 11 May 2016 01:37:25 -0400 Subject: Add snakemake-block-bounds function --- snakemake-test.el | 70 +++++-------------------------------------------------- 1 file changed, 6 insertions(+), 64 deletions(-) (limited to 'snakemake-test.el') diff --git a/snakemake-test.el b/snakemake-test.el index 034350c..d6f3d81 100644 --- a/snakemake-test.el +++ b/snakemake-test.el @@ -565,73 +565,15 @@ x = [1, (indent-region (point) (point-max)) (buffer-string))))) -;;;; Other +;;;; Info and navigation -(ert-deftest snakemake-test-in-rule-or-subworkflow-block-p () - ;; At top of block - (snakemake-with-temp-text - " -rule abc: - output: 'file'" - (should (snakemake-in-rule-or-subworkflow-block-p))) - - ;; Body of block - (snakemake-with-temp-text - " -rule abc: - output: 'file'" - (should (snakemake-in-rule-or-subworkflow-block-p))) - - ;; First blank line after - (snakemake-with-temp-text - " -rule abc: - output: 'file' -" - (should (snakemake-in-rule-or-subworkflow-block-p))) - - ;; Second blank line after - (snakemake-with-temp-text - " -rule abc: - output: 'file' - -" - (should-not (snakemake-in-rule-or-subworkflow-block-p))) - - - ;; Blank line in docstring - (snakemake-with-temp-text - " -rule abc: - \"\"\"docstring header - - docstring line - \"\"\" - output: 'file'" - (should (snakemake-in-rule-or-subworkflow-block-p))) - - ;; Before - (snakemake-with-temp-text - " +(ert-deftest snakemake-test-block-bounds () + (should-not + (snakemake-with-temp-text + " rule abc: output: 'file'" - (should-not (snakemake-in-rule-or-subworkflow-block-p))) - - ;; At beginning of buffer - (snakemake-with-temp-text - "\ -rule abc: - output: 'file'" - (should (snakemake-in-rule-or-subworkflow-block-p))) - - ;; Subworkflow - (snakemake-with-temp-text - " -subworkflow otherworkflow: - workdir: '../path/to/otherworkflow' - snakefile: '../path/to/otherworkflow/Snakefile'" - (should (snakemake-in-rule-or-subworkflow-block-p)))) + (snakemake-block-bounds)))) ;;; snakemake.el -- cgit v1.2.3