Commit Graph

29 Commits (caae145f5a8927de561ae48e31cb4b4f1b79df01)

Author SHA1 Message Date
John D Pell 4cf2aae36e lib/search: code cleanup
Improve `_bash-it-erase-term()`, `_bash-it-flash-term()`, `_bash-it-rewind()`, `_bash-it-search-result()`, and `_bash-it-search-component()`. Minor tweaks to `_bash-it-is-partial-match()`, and `_bash-it-search()`.
2022-01-28 13:35:17 -08:00
John D Pell afeb4d6e11 lib/search: `shellcheck`
SC2076
SC2091
SC2004
SC2086
SC2207
2022-01-28 13:35:17 -08:00
John D Pell da6b27166f tests: new file `test_helper_libs.bash`
For testing non-core files, just `load ../test_helper_libs` after `load ../test_helper` instead of trying to guess which libs must be loaded, in which order, for testing to succeed.

`_command_exists` spews log messages, so our test log is littered with `_log_debug not found`. This fixes that too.
2022-01-08 08:29:13 -08:00
John D Pell 9dcbeec7ad tests: test_helper already loads `composure.sh`
...and `cite()`s metadata
2022-01-08 08:29:13 -08:00
buhl 49d7d2e8c4 Getting Bash-it to use the vendored composure
Fixed tests
Fixed install.sh and bash_it.sh
Added gitattributes to the vendor folder
Changed documentation
2021-02-02 16:34:04 +01:00
Travis Swicegood ac3957393e Update tests so github-cli is expected 2020-10-10 02:39:02 +03:00
Nils Winkler 2f91e95af6
Adding log library to search tests
This might help with #1635.
2020-08-04 10:58:25 +02:00
Noah Gorny 3eac73f613 plugins: Rename gitstatusd plugin to gitstatus 2020-06-22 14:57:05 +03:00
Noah Gorny 4f4bae95e4 tests: Fix search git test 2020-06-22 14:56:13 +03:00
Nils Winkler 62bf3bf097
Fix search plugin tests
Had to move the `cite` definition up a couple of lines, since `_about`
is used in some of the tested plugins

Fixes #1582
2020-05-02 14:19:15 +02:00
Nils Winkler 818a95d79c
Refactored test setup code
Removed the copy/paste code, moved it into a reusable function that can
be called from the `local_setup` function as needed. Also simplified the
handling of the $HOME variable since @rico-chet provided a better way of
doing this.
2020-04-21 08:25:40 +02:00
Nils Winkler 34993f5da3
Excluding enabled directory when setting up test fixtures 2020-04-21 08:25:40 +02:00
Nils Winkler 3093273425
Updated rsync command to work with latest version of bats-core 2020-04-21 08:25:39 +02:00
John McBride 036c26dbed Update jump plugin
- remove z plugin
- remove fasd plugin
- update test that referenced fsad

Signed-off-by: John McBride <jpmmcbride@gmail.com>
2020-02-03 11:43:24 -07:00
Konstantin Gredeskoul 09c2be9d6b Refactor (extract utilities + add tests) & more…
* Extracting common utilities into utilities.bash
 * Adding new tests for utilities
 * Relocating the cache file to be under $BASH_IT
 * Removing cache cleanup deferral code for now
 * Wiping the cache in local_setup in tests.
2018-11-23 16:40:35 -08:00
Konstantin Gredeskoul baae0305b6 Speed up bash-it Search & support exact matches
This commit improves Bash-It search functionality in a couple of ways:

 * bash-it search (with no arguments) will print detailed help.
 * bash-it search now accepts terms prefixed with '@' sign, indicating an exact match.
 * bash-it search now performs smarter caching of the component listings/status

New search syntax is as follows:

   bash-it search [-|@]term1 [-|@]term2 [ --enable | --disable | --help ]
2018-11-19 11:55:36 -08:00
Nils Winkler 2691a5b138 Moved to bats-assert for assert functions 2017-10-14 18:00:43 +02:00
Nils Winkler 8319545b0a Switched to Bats-core as a submodule
Can't use the official v0.4.0 release, since our tests rely on a change
that was made after the release of v0.4.0.

This code currently uses an unversioned commit of the bats-core repo, we
will switch to a supported version once it has been released, e.g.
v0.4.1.
2017-10-14 18:00:43 +02:00
Nils Winkler d798bb8f06 Change test prefixes to match file name 2017-09-17 21:05:58 +02:00
Nils Winkler 2a16a5cd68 Change install setup to use rsync instead of cp 2017-09-17 21:05:57 +02:00
Nils Winkler 1e624113a7 Refactored search test cases to use the assert functions 2017-06-24 17:31:30 +02:00
Nils Winkler 2607bb815a Avoid polluting the user's Bash-it installation
All of the install steps are done in a test directory
2017-06-24 17:31:30 +02:00
Nils Winkler 58674d5a89 Updated unit tests 2016-05-23 08:45:46 +02:00
Nils Winkler 2618d2141f Fixed unit tests 2016-05-19 09:20:39 +02:00
Konstantin Gredeskoul db5061cf80 Better tests, more resilience and a bug fix 2016-05-12 04:04:51 -07:00
Konstantin Gredeskoul 81e3f1121b Get the test in a known state 2016-05-07 06:42:48 -07:00
Konstantin Gredeskoul 9bb2d377a8 Enable/Disable with negated search feature 2016-05-07 06:26:30 -07:00
Konstantin Gredeskoul fb6a6c80c0 Highlighting color of enabled components 2016-05-07 04:23:03 -07:00
Konstantin Gredeskoul ffbeeacc54 Moving search into its own module before more work 2016-05-07 04:19:03 -07:00