Changes from v1:

  * fix a bug that caused the Zsh test cases to run in Zsh's sh
    emulation mode, not Zsh "native" mode


This series adds test cases for running __git_ps1 (see
contrib/completion/ from Zsh.

This series also adds more Bash test cases to test how __git_ps1
reacts to disabling Bash's PS1 parameter expansion.  (This is related
to adding Zsh test cases:  Zsh doesn't perform parameter expansion on
PS1 by default but many users turn it on, so the Zsh test script must
test __git_ps1 in both states.  Bash expands PS1 by default and users
rarely turn it off, but testing both states in Bash improves the
symmetry with the Zsh test cases.)

This is the approach I took:

  1. delete the last test case in t9903 ("prompt - zsh color pc mode")
  2. add two new functions to t/
         ps1_expansion_enable () { shopt -s promptvars; }
         ps1_expansion_disable () { shopt -u promptvars; }
  3. loop over the relevant test cases twice:  once after calling
     ps1_expansion_enable and once after calling ps1_expansion_disable
     (with appropriate adjustments to the expected output)
  4. move the test cases in t9903 to a separate library file and
     source it from
  5. create two new files:
       * t/ (same as t/ but tweaked for zsh)
       * t/ (same as t/ but
         tweaked for zsh)

There are a lot of indendation changes, so I recommend examining the
changes via diff -w.

Richard Hansen (11):
  t9903: remove Zsh test from the suite of Bash prompt tests
  t9903: put the Bash pc mode prompt test cases in a function
  t9903: move test name prefix to a separate variable
  t9903: run pc mode tests again with PS1 expansion disabled
  t9903: include "Bash" in test names via new $shellname var
  t9903: move PS1 color code variable definitions to
  t9903: move prompt tests to a new file put all tests inside a function add variable for string that encodes percent in
  test-lib: make it possible to override how test code is eval'd
  t9904: new __git_ps1 tests for Zsh

 t/          |  12 +
 t/  | 654 +++++++++++++++++++++++++++++++++++++++++++++++++
 t/           |  52 ++++
 t/ | 582 +------------------------------------------
 t/  |  10 +
 t/          |   7 +-
 6 files changed, 736 insertions(+), 581 deletions(-)
 create mode 100644 t/
 create mode 100644 t/
 create mode 100755 t/


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to