The cardinality check shall —
- if the test sets \$expected_mismatch, be XFail;
- elif any test points is XFail, be skipped;
- else, be expected to pass.
To test this, change «6 * 9» to «6 + 9» in test-data/arith1.zsh that
will be added in the after-next (grandchild) commit.
* danielsh/tests-skip-cardinality-v1:
tests: Minor documentation readability tweak
Add a test for issue #641.5, using the infrastructure added in the previous commits.
tests: Skip cardinality tests whenever any test point is expected to fail.
tests: Make $expected_mismatch skip the cardinality check, rather than consider it an expected failure.
tests: Include the name of the 'cardinality check' test point in the output
When writing an expected-to-fail test case, the cardinality of $region_highlight
at the time the test is written may differ from the cardinality it will have
once the bug is fixed. For example, with issue #641.5, the current highlighting
is ['nice', 'x=y', 'y', 'ls'] — four elements — but the correct highlighting
would have three elements: ['nice', 'x=y', 'ls']. There is no point in reporting
a separate test failure for the cardinality check in this case, nor for 'ls' being
highlighted as 'command' rather than 'default'.
At the same time, in other cases the current and correct highlighting may have the
same number of elements (for example, this would be the case for a hypothetical
"the command word is highlighted as an alias rather than a function" bug). Thus,
the previous commit, q.v..
than consider it an expected failure.
With this change, if $expected_region_highlight and $region_highlight
coincidentally have the same number of elements, the test won't be considered
to fail.
This is useful in conjunction with the next commit, q.v..
At this time, no tests set $expected_mismatch explicitly. However, the
commit after next (this commit's grandchild) will add a test that will
set $expected_mismatch implicitly, using the functionality in the next
commit (this commit's child).
Fixeszsh-users/zsh-syntax-highlighting#262.
Currently, 'make quiet-test' uses Perl. However, since it is considered a development
tool rather than a user-facing tool, users and downstream packages needn't install Perl.
Furthermore, even this dev-only dependency may be dropped in the future.
The only difference between tests/tap-filter here and the one in the issue is using
a `cat` subshell v. using 'undef $/; <STDIN>'.
Fixes zsh-users/zsh-syntax-highlighting#182.
Prerequisite for testing issue #228.
* tests/test-highlighting.zsh
(run_test): Move functionality to run_test_internal; make run_test be a wrapper
that handles creating and cleaning up the tempdir.
* tests/README.md: Document the new feature.
* "highlighters/main/test-data/path-space- .zsh"
* highlighters/main/test-data/path-tilde-named.zsh
* highlighters/main/test-data/path.zsh
Change test data to not depend on being run from the source directory.
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>
* Don't override user defined styles
* Better modularisation of highlighters
* Allow to define which highlighters are activated
* Allow to define the order in which they are defined
* Minor performance optimizations
* Fixed some variables leak
* Improve documentation
* Brackets highlighter: use ZSH_HIGHLIGHT_STYLES instead of a specific array