From 364f206a547f350ddf2cee2d122859cfb03b4a4d Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 5 May 2016 23:31:58 -0500 Subject: [PATCH] docs: Give example of test that modifies its environment --- tests/README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index 6461708..d55945f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -25,8 +25,19 @@ interprets the indexes differently. aliases, functions, etc., it defines will be visible to the tested code (that computes `$region_highlight`), but will not affect subsequent tests. The current working directory of tests is set to a newly-created empty directory, -which is automatically cleaned up after the test exits. +which is automatically cleaned up after the test exits. For example: + setopt PATH_DIRS + mkdir -p foo/bar + touch foo/bar/testing-issue-228 + chmod +x foo/bar/testing-issue-228 + path+=( "$PWD"/foo ) + + BUFFER='bar/testing-issue-228' + + expected_region_highlight=( + "1 21 command" # bar/testing-issue-228 + ) Highlighting test -----------------