[PATCH v2 00/11] Zsh prompt tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changes from v1:

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

Description:

This series adds test cases for running __git_ps1 (see
contrib/completion/git-prompt.sh) 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/lib-bash.sh:
         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 t9903-bash-prompt.sh
  5. create two new files:
       * t/lib-zsh.sh (same as t/lib-bash.sh but tweaked for zsh)
       * t/t9904-zsh-prompt.sh (same as t/t9903-bash-prompt.sh 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 lib-bash.sh
  t9903: move prompt tests to a new lib-prompt-tests.sh file
  lib-prompt-tests.sh: put all tests inside a function
  lib-prompt-tests.sh: add variable for string that encodes percent in
    PS1
  test-lib: make it possible to override how test code is eval'd
  t9904: new __git_ps1 tests for Zsh

 t/lib-bash.sh          |  12 +
 t/lib-prompt-tests.sh  | 654 +++++++++++++++++++++++++++++++++++++++++++++++++
 t/lib-zsh.sh           |  52 ++++
 t/t9903-bash-prompt.sh | 582 +------------------------------------------
 t/t9904-zsh-prompt.sh  |  10 +
 t/test-lib.sh          |   7 +-
 6 files changed, 736 insertions(+), 581 deletions(-)
 create mode 100644 t/lib-prompt-tests.sh
 create mode 100644 t/lib-zsh.sh
 create mode 100755 t/t9904-zsh-prompt.sh

-- 
2.0.0

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]