Commit graph

100 commits

Author SHA1 Message Date
Daniel Shahaf
027f522300 test harness: Honour $expected_mismatch when there are more expected than observed highlights.
Required for the next commit.
2020-02-28 22:31:43 +00:00
Daniel Shahaf
2b3638a211 test harness: Tweak quiet-test output
- Print the test name and data after the plan line

- Split on the plan line rather than on comments

  + That makes tap-filter more suitable to filter TAP output generated by other
    TAP producers.

  + However, the filtered output deletes the plan line and adds a blank line in
    its stead.  This suits our use-case of interactive test runs.
2020-02-22 15:12:24 +00:00
Daniel Shahaf
3414c7c0d2 test harness: Include $PREBUFFER and $BUFFER in the output.
For human readers' benefit.
2020-02-22 15:12:24 +00:00
Daniel Shahaf
4a043b4d15 noop: Whitespace changes only.
./.editorconfig is already set correctly.
2020-02-22 15:12:24 +00:00
Daniel Shahaf
dc70e89bfd tests: Support non-arrays in typeset_p(). 2020-02-22 15:12:24 +00:00
Daniel Shahaf
deee22ed42 tests: Don't filter out tests that aborted.
Useful in piping Travis CI output through tap-filter manually.
2020-01-24 00:49:51 +00:00
Daniel Shahaf
9ed2a46ed2 dev tools: New script to ease opening $EDITOR on failing tests.
Has room for improvement; for now, I use it with CTRL-W_f.
2020-01-16 17:19:25 +00:00
Daniel Shahaf
1c6a6d92b0 dev tools: Allow specifying preamble code when generating test cases. 2020-01-16 17:19:25 +00:00
Daniel Shahaf
c0ad50e645 dev tools: Fix regression introduced in commit "Print the test data to stdout for convenience.".
tee(1) truncated $fname.  Fortunately, the data that got truncated had just
been `git add`-ed, so no harm was done.
2020-01-11 20:49:12 +00:00
Daniel Shahaf
6f1f595e3e dev tools: Print the test data to stdout for convenience. 2020-01-07 19:59:49 +00:00
Sean Wei
4fb570e104
docs: Enable Syntax Highlighting for Code Snippits 2019-01-13 16:12:41 +08:00
Matthew Martin
693757bfd7 tests: Run harness in an anon function to catch global variables
Thanks Daniel for the set -- suggestion.
2019-01-12 00:36:42 -06:00
Matthew Martin
3259fe338d Revert "tests: Run tests in an anon function to catch global variables"
This reverts commit ba2d8fcf76.

Breaks 4.3.12 and .11
2019-01-06 21:38:13 -06:00
Matthew Martin
ba2d8fcf76 tests: Run tests in an anon function to catch global variables
This would have caught #593.
2019-01-06 21:23:46 -06:00
Matthew Martin
9bd38c6fc0 tests: Use root variable for root of the project 2019-01-06 21:21:42 -06:00
Matthew Martin
dddea5d5dd tests: Set harness variables local 2019-01-06 21:18:41 -06:00
Daniel Shahaf
06893a3873 tests: Escape region_highlight and expected_region_highlight in TAP output.
Required for TAP compliance in case the output ever contains '#' or '\n'.
2018-12-29 12:15:34 +00:00
Daniel Shahaf
580ccaebb8 tests: (try to) Fix test failure under zsh<5.3, where 'typeset -p arrayvar''s is two lines long. 2018-12-29 11:57:15 +00:00
Daniel Shahaf
7cb5ad0f9b tests: Tweak XFAIL/XPASS output of cardinality check.
Stylistic tweaks only; no functional change, no effect on TAP compliance.
2018-12-29 11:46:18 +00:00
Daniel Shahaf
cd1647f4d4 tests: Follow-up to grandparent: Make the cardinality check XPASS properly when it should. 2018-12-29 11:42:34 +00:00
Daniel Shahaf
864864442e tests: Allow marking the cardinality check as TODO (XFail).
Needed for next commit.
2018-12-29 11:31:18 +00:00
Matthew Martin
a9be0975c8 tests: Directly diff expected_region_highlight against region_highlight 2018-02-10 14:49:07 -06:00
Matthew Martin
7b417be1ce tests: Escape newlines in TAP description 2018-02-10 13:23:08 -06:00
Daniel Shahaf
c969a1f26a tests: Include the filename in error messages.
The new failure mode is:
.
    Running test main
    Bail out! On './highlighters/main/test-data/glob.zsh': Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank
    Bail out! On './highlighters/main/test-data/glob.zsh': output on stderr
    Running test pattern

Fixes #478.
2018-01-12 14:28:08 +00:00
Daniel Shahaf
8652a8f4e4 Bump copyright years. 2017-12-25 08:42:30 +00:00
Matthew Martin
f4d37b74cc tests: Add ability to skip tests 2017-11-06 07:08:53 -06:00
Matthew Martin
4bd30737dc tests: Support SKIP directive in tap-colorizer 2017-11-06 07:08:21 -06:00
Matthew Martin
038409c10d tests: Run tests with WARN_CREATE_GLOBAL 2017-11-05 15:04:49 -06:00
Matthew Martin
c948a3caa0 tests: Declare local variables 2017-11-05 12:23:42 -06:00
Matthew Martin
18517cc98e tests: Run tests with NOUNSET 2017-11-05 08:06:45 -06:00
Matthew Martin
459c128f43 tests: Set ZLE variables to sane defaults 2017-11-05 08:06:45 -06:00
Matthew Martin
079ea39f74 tests: Ensure region highlight is unset if NONE is expected 2017-11-05 08:06:45 -06:00
Matthew Martin
a9ce931439 Default possibly unset variables to empty 2017-11-04 20:26:07 -05:00
Matthew Martin
a33c72e838 tests: Use idiomatic set check 2017-11-02 20:08:28 -05:00
Daniel Shahaf
5efd062a4d tests: Add a regression test for issue #392 (aliases beginning with a '+' are lost). 2016-12-03 13:54:47 +00:00
Daniel Shahaf
67be62107b tests: Move some code in preparation for next commit. No functional change. 2016-12-03 13:54:47 +00:00
Daniel Shahaf
2b303f01b6 dev tools: Automagically handle newlines (\n) in $BUFFER. 2016-09-27 22:55:16 +00:00
Daniel Shahaf
a2876fb57d dev tools: Add a TODO to introduce code reuse. 2016-09-25 11:38:54 +00:00
Daniel Shahaf
a053768627 dev tools: Remove a superfluous empty line. 2016-09-25 08:11:01 +00:00
Daniel Shahaf
5627fd2045 dev tools: Stage the copyright block to make diffs smaller. 2016-09-24 17:07:01 +00:00
Daniel Shahaf
987c133486 dev tools: Tolerate invalid input. 2016-09-24 17:06:21 +00:00
Daniel Shahaf
e15a09840e dev tools: Automate a recurring step: Set year correctly for new tests. 2016-09-23 06:37:28 +00:00
Daniel Shahaf
e2f863c151 minor: Fix typo in development usage message. 2016-08-12 09:19:36 +00:00
Daniel Shahaf
add6825898 dev tools: Extend tests/generate.zsh. 2016-07-29 19:02:40 +00:00
Daniel Shahaf
8013dc3b8d dev tools: Add a script that generates a test-data file. 2016-07-29 18:58:37 +00:00
Daniel Shahaf
fccf92402b minor: tests: Formatting tweak to XPASS output.
Remove superfluous single quotes around the second hyphen.
2016-06-03 03:57:45 +00: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