]> git.madduck.net Git - etc/vim.git/blobdiff - test/insert-toc.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/vim-markdown/' changes from da5a7ac9..8f6cb3a6
[etc/vim.git] / test / insert-toc.vader
diff --git a/test/insert-toc.vader b/test/insert-toc.vader
new file mode 100644 (file)
index 0000000..b8d669b
--- /dev/null
@@ -0,0 +1,147 @@
+Given markdown;
+# a
+
+## Foo Level 2
+
+### Foo Level 3
+
+#### Foo Level 4
+
+Bar Level 2
+-----------
+
+### Bar Level 3
+
+Execute (InsertToc format):
+  :2
+  :call append('.', '')
+  :InsertToc
+
+Expect (format):
+  # a
+
+  * [Foo Level 2](#foo-level-2)
+    * [Foo Level 3](#foo-level-3)
+      * [Foo Level 4](#foo-level-4)
+  * [Bar Level 2](#bar-level-2)
+    * [Bar Level 3](#bar-level-3)
+
+  ## Foo Level 2
+
+  ### Foo Level 3
+
+  #### Foo Level 4
+
+  Bar Level 2
+  -----------
+
+  ### Bar Level 3
+
+Given markdown;
+# a
+
+## Foo Level 2
+
+### Foo Level 3
+
+#### Foo Level 4
+
+Bar Level 2
+-----------
+
+### Bar Level 3
+
+Execute (InsertToc only h2 headers):
+  :2
+  :call append('.', '')
+  :InsertToc 2
+
+Expect (only h2 headers):
+  # a
+
+  * [Foo Level 2](#foo-level-2)
+  * [Bar Level 2](#bar-level-2)
+
+  ## Foo Level 2
+
+  ### Foo Level 3
+
+  #### Foo Level 4
+
+  Bar Level 2
+  -----------
+
+  ### Bar Level 3
+
+Given markdown;
+# a
+
+## Foo Level 2
+
+### Foo Level 3
+
+#### Foo Level 4
+
+Bar Level 2
+-----------
+
+## Baz Level 2
+
+## Foobar Level 2
+
+## Foobaz Level 2
+
+## Barfoo Level 2
+
+## Barbaz Level 2
+
+## Bazfoo Level 2
+
+## Bazbar Level 2
+
+## Foobarbaz Level 2
+
+Execute (InsertNToc format, and up to h3 headers):
+  :2
+  :call append('.', '')
+  :InsertNToc 3
+
+Expect (format, and up to h3 headers):
+  # a
+
+   1. [Foo Level 2](#foo-level-2)
+      * [Foo Level 3](#foo-level-3)
+   2. [Bar Level 2](#bar-level-2)
+   3. [Baz Level 2](#baz-level-2)
+   4. [Foobar Level 2](#foobar-level-2)
+   5. [Foobaz Level 2](#foobaz-level-2)
+   6. [Barfoo Level 2](#barfoo-level-2)
+   7. [Barbaz Level 2](#barbaz-level-2)
+   8. [Bazfoo Level 2](#bazfoo-level-2)
+   9. [Bazbar Level 2](#bazbar-level-2)
+  10. [Foobarbaz Level 2](#foobarbaz-level-2)
+
+  ## Foo Level 2
+
+  ### Foo Level 3
+
+  #### Foo Level 4
+
+  Bar Level 2
+  -----------
+
+  ## Baz Level 2
+
+  ## Foobar Level 2
+
+  ## Foobaz Level 2
+
+  ## Barfoo Level 2
+
+  ## Barbaz Level 2
+
+  ## Bazfoo Level 2
+
+  ## Bazbar Level 2
+
+  ## Foobarbaz Level 2