Commit Graph
39 Commits
Author SHA1 Message Date
Matthew Martin 91fa057a39 minor: 'main': Only search for prefixes if :h is a directory 2016-06-01 00:54:30 -05:00
Matthew Martin d37c55c788 minor: tests: Add comment for NONE in expected_region_highlight 2016-05-12 22:59:06 -05:00
Matthew Martin 364f206a54 docs: Give example of test that modifies its environment 2016-05-12 22:48:07 -05:00
Matthew Martin 19acd8e844 docs: Mention $BUFFER 2016-05-12 22:48:03 -05:00
Matthew Martin 13018f3dd7 docs: Document use of NONE in expected_region_highlight 2016-05-12 22:47:55 -05:00
Matthew Martin 0f43026bf0 docs: Document writing tests 2016-05-12 22:40:34 -05:00
Matthew Martin 1082067f93 tests: Fail on stderr output
Closes #291.
2016-05-12 22:32:34 -05:00
Matthew Martin 9cab566f53 docs: Document installation with other plugin managers
Closes #297.
2016-05-06 09:30:13 -05:00
Matthew Martin bb341f186c dev docs: Document testing quirks 2016-05-05 16:25:37 -05:00
Matthew Martin b5955213b9 tests: Add tests for 'brackets' and 'pattern' 2016-05-05 15:36:33 -05:00
Matthew Martin f73f3d53d3 'brackets': Allow unset ZSH_HIGHLIGHT_STYLES
Without this when bracket_color_size is 0,
    $(( (levelpos[$pos] - 1) % bracket_color_size + 1 ))
errors with division by zero.
2016-05-05 13:56:09 -05:00
Matthew Martin eaa4335c34 tests: Set ZSH_HIGHLIGHT_STYLES=() during tests
Since the _zsh_highlight_add_highlight that the tests use ignores
ZSH_HIGHLIGHT_STYLES, we can test both an injective mapping and an empty
mapping at once.
2016-05-05 12:31:52 -05:00
Matthew Martin d3678ec7a8 tests: Remove unused_highlight 2016-05-05 12:28:43 -05:00
Matthew Martin fd061b5730 tests: Test ZSH_HIGHLIGHT_STYLES keys directly
Closes #287. Testing the keys directly removes the need for
unused_highlight which will be removed next.
2016-05-05 12:28:39 -05:00
Matthew Martin ccaf6f48a1 brackets: Fix bug introduced in 95d8256 2016-05-05 09:59:26 -05:00
Matthew Martin e05b8e88ad 'brackets': Check if brackets match on first pass
This removes the need for the typepos array.
2016-05-04 20:50:55 -05:00
Matthew Martin 95d82568d8 'brackets': Use one-based indexing
zsh arrays start at one, and this will make the next commit easier.
2016-05-04 20:50:55 -05:00
Matthew Martin f4d3dcb42f 'brackets': Move highlight call outside conditional 2016-05-04 20:50:55 -05:00
Matthew Martin fd84010252 'brackets': Lift local declarations from inside loops 2016-05-04 20:50:55 -05:00
Matthew Martin 4da9889d15 tests: Use 'NONE' to denote no highlighting
'none' is a valid highlighting type. Since by convention styles are all
lowercase, 'NONE' shouldn't conflict with anything.

Closes #289.
2016-04-30 12:48:44 -05:00
Matthew Martin c346f6eb6f docs: highlighters should use _zsh_highlight_add_highlight 2016-04-29 21:52:41 -05:00
Matthew Martin 341a3ae1f0 highlighters: Use _zsh_highlight_add_highlight
_zsh_highlight_add_highlight appends to region_highlight $1 $2 and the
next non-null parameter. If there is no non-null parameter, do nothing,
This is so that highlighters can add a style with fallbacks if the most
specific style is not defined. If none of the applicable styles are
defined, do the right thing and don't add an invalid entry to
region_highlight.

The pattern highlighter doesn't use this function as it'd need too large
of an API change.
2016-04-29 10:09:16 -05:00
Matthew Martin 089329660b highlighters: Pass around the style key instead of the style itself 2016-04-29 09:53:05 -05:00
Matthew Martin a830613467 tests: Specify the style key instead of the style itself 2016-04-29 09:51:13 -05:00
Matthew Martin 78290e043b tests: Expect the correct style 2016-04-03 20:43:13 -05:00
Matthew Martin 31ac2b36a9 tests: Quote style in expected_region_highlight 2016-04-02 09:45:24 -05:00
Matthew Martin bb8d325c0c tests: Fix grep syntax
In basic regular expressions | is not a special character that spearates
branches, so use an extended regular expression.
2016-04-01 00:52:27 -05:00
Matthew Martin 8e115052e9 docs: Fix broken symlinks 2015-11-24 00:40:09 -06:00
Matthew Martin f5ca4b891b Remove broken links 2015-11-24 00:27:21 -06:00
Matthew Martin 51f66ae851 docs: Create all.md 2015-11-24 00:22:26 -06:00
Matthew Martin 0ab450ae47 docs: Move docs into docs/ 2015-11-24 00:09:21 -06:00
Matthew Martin 35e0b0ca69 docs: Remove duplicate 'How to activate it' sections 2015-11-24 00:09:21 -06:00
Matthew Martin 2dd6923c30 docs: Move highlighter headers down one level 2015-11-24 00:09:21 -06:00
Matthew Martin d99aa58aaa test harness: Run each test as a single subshell.
That allows tests to be completely independent of each other, so tests that
change global state — such as modify environment variables, define functions or
aliases, or hash commands — will not affect other tests, without needing an
explicit cleanup step.

This enables testing path-tilde-home with and without $HOME set, which is part
of issue #216.

While at it, convert the test harness to TAP.  This fixes issue #180 by adding
support for "not ok 42 # TODO" output.

This commit assumes that 'grep' supports POSIX-compliant -q and -v flags.

Patch-by: Matthew Martin <phy1729@gmail.com>
2015-10-23 03:31:00 +00:00
Matthew Martin 72b1abd17d Makefile: declare PHONY targets 2015-10-20 00:26:43 +00:00
Matthew Martin 94191f0731 Makefile: Add default for INSTALL 2015-10-19 01:45:15 -05:00
Matthew Martin 2883c9582d Makefile: exit non-zero for a failed test 2015-10-19 01:45:15 -05:00
Matthew Martin 83c3f96109 Makefile: Add test target 2015-10-19 01:45:15 -05:00
Matthew Martin 7aeadfe01b Add Makefile 2015-10-19 01:45:15 -05:00