Commit Graph

70 Commits

Author SHA1 Message Date
Tom "Ravi" Hale
e5da83665a bin_path(): use builtin commands and avoid which 2018-09-14 19:58:25 +07:00
Tom "Ravi" Hale
e46a7c3309 ls_with_file_shortcuts: fail rather than create incorrect variables
Removes the danger from issue #274.

The proper fix will need to address issue #260.
2018-09-14 19:58:09 +07:00
Tom "Ravi" Hale
80ec1ad2ad Replace built-in shell array quoting with printf %q 2018-09-12 17:57:46 +07:00
Tom "Ravi" Hale
695941b596 Add tests for exec_scmb_expand_args() 2018-09-02 11:34:32 +07:00
Tom "Ravi" Hale
f55ce1e6a3 test_ls_with_file_shortcuts: clean up temp files 2018-09-02 11:34:32 +07:00
Tom "Ravi" Hale
5a8c2fec12 assert(Not)?Includes: check for failure of _includes
Call _includes and then check its return value.

shunit2 uses the exit code to test, not a string of 0 or 1 as was done
previously.
2018-09-02 11:32:02 +07:00
Tom "Ravi" Hale
ed63b41182 test_helper: Don't clobber global name/email config
Config included by gitconfig [include] is not considered global.

Test git config values without --global to include local config as well.

Change only local config (not global) if needed.
2018-09-02 11:28:47 +07:00
Tom "Ravi" Hale
b193438ca1 shell_shortcuts_test: Unset $QUOTING_STYLE for predictable ls output 2018-09-02 11:28:47 +07:00
Tom "Ravi" Hale
73ed8cb53e scmb_expand_args: return an array to fix quoting issues 2018-09-02 11:28:47 +07:00
Tom "Ravi" Hale
fb7d227c30 Add _safe_eval: quote $@ elements before eval 2018-09-02 11:28:19 +07:00
Tom "Ravi" Hale
d5c60b2cc5 git_status_shortcuts: don't clobber $IFS 2018-09-01 20:19:57 +07:00
Tom "Ravi" Hale
5f286eaaaa Quote arrays to avoid splitting by $IFS 2018-09-01 20:14:36 +07:00
Willa Drengwitz
fc679a06ac Update strip color perl command 2018-08-31 13:53:51 -04:00
Wilhelmina Drengwitz
77916f056a Add bash & zsh compatible way to resolve abs exe paths 2018-08-31 09:09:46 -04:00
Willa Drengwitz
f5850830fa Fix tr illegal command 2018-08-31 09:01:06 -04:00
Willa Drengwitz
89cf0eb6ad Run shfmt 2018-08-31 08:58:41 -04:00
Willa Drengwitz
d0c8329137 Fix sorting order 2018-08-31 08:58:23 -04:00
Willa Drengwitz
a3ff809cbe Fix ordering to match declare order 2018-08-31 07:56:58 -04:00
Willa Drengwitz
e6363ac955 Merge remote-tracking branch 'mroth/osx-testing' into osx-testing 2018-08-31 07:48:09 -04:00
Nathan Broadbent
6745822953 Fix IFS issues - have to always unset after use 2017-02-19 20:05:59 +07:00
Martino Visintin
39f6596861 fix bin path testing 2017-02-12 20:43:00 +00:00
Wilhelmina Drengwitz
6f4babeced Extend tests to use conditional exe paths 2017-01-31 15:50:14 -05:00
Martino Visintin
455239f594 make tests independent of bin locations
On my system (Arch Linux), the commands {mv,rm,sed} live under
`/usr/bin`, not under `/bin`. So the tests were failing.

This commit hard-codes the initial paths to make the tests independent
on their real paths.
2017-01-27 21:41:53 +00:00
James Ravn
bdf6096808 Fix quoting of semicolon and pipe 2015-05-10 00:39:05 +01:00
Jean Blanchard
349896b0cf Make ls aliases optional 2015-03-06 09:41:31 +00:00
Matthew Rothenberg
ae4b93f52f declare original location of cmds
The previous tests assumed default locations for all commands, however
they do not exist in the same place on all *nixes.  I encountered this
when the test was failing on MacOSX where it was expected hardcoded
`/bin/sed` when in fact the code was identifying the correct local
expansion of `/usr/bin/sed`.

To make this test more robust, it now checks for the original location
of all cmds and uses that in its expansion tests for
`test_shell_command_wrapping()`.
2014-10-16 17:05:43 -04:00
Matthew Rothenberg
1cd162434f Make sure we have physical path back from mktemp
Darwin actually symlinks /var inside /private, but mktemp reports back
the logical pathat time of file creation.  So make sure we always get
the full physical path to be absolutely certain when doing comparisons
later, because thats how the Ruby status_shortcuts.rb script is going to
obtain them.
2014-10-16 17:05:43 -04:00
Matthew Rothenberg
b2d86a16b2 use perl instead of sed -r to strip colors in test
`sed -r` is not present on some BSD based systems, including MacOSX
Darwin.  perl is standard pretty much everywhere, so this a more
reliable way to test.

Since this is only used for tests, any performance differences
should not matter significantly.
2014-10-16 15:31:12 -04:00
Matthew Rothenberg
b395596496 dont use grep -P for cross-platform compatibility
`grep -P` gives access to the PCRE matching engine, which is nice,
however, the version of grep shipped on many BSD systems (including
Darwin) does not have this flag.

Currently, `grep -P` was being used in the `_includes()` test helper.

For cross platform compatibility in tests, do not rely upon this option.
Luckily, all existing tests seem to work fine without it already!
2014-10-16 15:26:34 -04:00
Matthew Rothenberg
e7c56c7647 only install zsh on boxes that need it
don’t bother on macosx (preinstalled) or if the test matrix for that
box isn’t going to be testing in zsh.

this should speed up test runs for most cases, and later we can define
fast_failure and not have to wait for the longer ones.
2014-10-16 15:25:58 -04:00
Matthew Rothenberg
802f4987c3 set up multi-os testing in travis
Requires beta access, thankfully the travis gods have blessed us for the
main repo and my fork!

This should allow us to make sure scm_breeze operates reliably in both
Linux and BSD/Darwin, because there are small shell differences
(especially with default tools) that are causing errors I noticed on
MacOSX.
2014-10-16 15:23:10 -04:00
Nathan Broadbent
c575f171c2 Fixed case-insensitive matching... my last commit was pretty dumb 2013-07-09 20:10:57 +12:00
Nathan Broadbent
fc9d7787b1 Updated demo user setup 2013-04-09 12:04:45 +12:00
Nathan Broadbent
7ffbaefb03 Set up demo git user for tests 2013-04-09 12:03:43 +12:00
Nathan Broadbent
dd10be79e2 Re-wrap functions as functions. Fixes issue with RVM reload (cd wrapper will be overwritten without error) 2013-01-30 22:29:05 +13:00
Nathan Broadbent
3692db6a3a Ensure tests run if RVM isn't loaded but $HOME/.rvm is present 2013-01-30 12:09:44 +13:00
Nathan Broadbent
d1a9df3844 Added keyboard shortcut to append [ ci skip ] to commit message when committing all files 2013-01-30 11:05:59 +13:00
Nathan Broadbent
bc969b3e6f Fixed tests 2012-11-17 11:49:46 +13:00
Nathan Broadbent
436b0da138 Further ll fixes for escaped spaces and quotes! 2012-10-23 23:34:17 +13:00
Nathan Broadbent
4d62b25ed6 Made tests a bit neater with indentation 2012-10-23 12:39:30 +13:00
Nathan Broadbent
06c2e26804 Added test for ls with subdirectory 2012-10-23 12:30:25 +13:00
Nathan Broadbent
5836617dbf Fully fixed up ll escaping, added lots of tests 2012-10-23 12:25:28 +13:00
Nathan Broadbent
32a184d8c0 '.' => 'source' (some people alias '.' as something different) 2012-09-19 21:40:29 +12:00
Nathan Broadbent
11f2284c5a Added SCM Breeze helpers to test helper 2012-09-19 21:35:25 +12:00
Nathan Broadbent
eeb5d321d6 Stub out zsh's vared in tests 2012-08-28 12:26:57 +12:00
Nathan Broadbent
fee234b124 Added tests for shell command wrapping 2012-08-23 11:10:40 +12:00
Nathan Broadbent
accbcc5957 git_expand_args => scmb_expand_args 2012-08-15 21:10:46 +12:00
Nathan Broadbent
9410387485 Added test for new fallback explanation message 2012-08-13 01:23:27 +12:00
Nathan Broadbent
aaf4f5fac5 Use tabs as delimiter so that files with spaces are properly handled. Escape spaces only in exec_git_expand_args, use tabs to split everything else. 2012-08-13 00:22:16 +12:00
Nathan Broadbent
9fe0f45185 Fixed design tests - needs a git repo 2012-08-12 21:45:55 +12:00