From: Ciro Santilli Date: Sun, 7 Sep 2014 15:54:58 +0000 (+0200) Subject: Add unit tests and travis support. X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/4b8f631148d5ed7830cc34a7aa91ef71ea253f84?ds=inline Add unit tests and travis support. --- diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..12bf12e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: vim + +install: | + sudo apt-get update + sudo apt-get install vim + cd .. + git clone https://github.com/godlygeek/tabular + git clone https://github.com/junegunn/vader.vim + +script: | + cd "$TRAVIS_BUILD_DIR" + ./test/run-tests.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a603db..b29b8cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,12 +36,4 @@ If you wish to have a behavior that differs from that style guide, add an option # Tests -All new features must have tests. We don't require unit tests: tests that require users to open markdown code in Vim and check things manually are accepted, but you should point clearly to where the tests are. - -Wherever possible, use test cases from the [karlcow's Markdown Test Suite](https://github.com/karlcow/markdown-testsuite), and link to the relevant test files on your merge request. - -If a test does not exist there yet, make a pull request to them, and link to that pull request on the pull request you make here. - -If the test you want to do is not appropriate for the Markdown Test Suite, create it only under the `test/` directory here. - -If we start disagreeing too often on what is appropriate or not, we will fork off that repository. +All new features must have unit tests. diff --git a/README.md b/README.md index 18044db..8ff3b59 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Markdown Vim Mode +[![Build Status](https://travis-ci.org/plasticboy/vim-markdown.svg)](https://travis-ci.org/plasticboy/vim-markdown) + Syntax highlighting, matching rules and mappings for [the original Markdown](http://daringfireball.net/projects/markdown/) and extensions. ## Installation diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..1817e55 --- /dev/null +++ b/test/README.md @@ -0,0 +1,7 @@ +To run the tests, you must install [Vader](https://github.com/junegunn/vader.vim). + +Vader and other plugins must be installed in the same directory as this repository. + +Run the tests with: + + ./run-tests.sh diff --git a/test/run-tests.sh b/test/run-tests.sh new file mode 100755 index 0000000..c8c6213 --- /dev/null +++ b/test/run-tests.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cd "$( dirname "${BASH_SOURCE[0]}" )" && vim -Nu vimrc -c 'Vader! *' > /dev/null diff --git a/test/syntax.vader b/test/syntax.vader new file mode 100644 index 0000000..9d2e866 --- /dev/null +++ b/test/syntax.vader @@ -0,0 +1,11 @@ +Given mkd (bold); +**bold** not bold + +Execute (SyntaxOf(pattern)): + AssertEqual SyntaxOf('b'), 'htmlBold' + +Given mkd (italic); +*italic* + +Execute (SyntaxOf(pattern)): + AssertEqual SyntaxOf('i'), 'htmlItalic' diff --git a/test/vimrc b/test/vimrc new file mode 100644 index 0000000..86020ed --- /dev/null +++ b/test/vimrc @@ -0,0 +1,8 @@ +set nocompatible +set rtp+=../ +set rtp+=../../tabular/ +set rtp+=../../vader.vim/ +filetype on +filetype plugin on +filetype indent on +syntax on