apacman icon indicating copy to clipboard operation
apacman copied to clipboard

Collection of bug fixes - Change regex to basic

Open lectrode opened this issue 6 years ago • 0 comments

Addresses the following:

Resolves #63

  • Instead of using Extended Regex (which interferes with some symbols), just use Basic Regex
  • Wildcards are supported as .* (example: apacman -S apacm.*)

Resolves #79

  • Add support for + and @ symbols in packages
  • No need to disable regex mode as it will only be enabled if there are unsupported symbols detected

Resolves #80

  • echo to /dev/tty to ensure it is visible

Resolves #86

  • Ensures width variables are defined before using them in math

Additionally, this fixes some of the tests in tests.bats (including a proot crash workaround) and skips testing non-existant "broken" package.

I also made sure to run the tests.bats file against my changes before submitting the pull request:

$ bats tests.bats
 ✓ test command is found
 ✓ invoking without arguments prints usage
 ✓ invoke with nonexistent parameter returns 1
 ✓ invoking with '--help' parameter prints usage
 ✓ invoke with '--version' parameter prints ascii art
 ✓ invoke with '--verbose' parameter without package argument
 ✓ test internet connectivity
 ✓ interactive search install package
 ✓ interactive search install nonexistant package
 ✓ invoke with '-S' parameter installs package from AUR
 - invoke with '-S' parameter fails to build broken package from AUR (skipped)
 ✓ invoke with '-S' parameter installs cached AUR package
 ✓ invoke with '-S' parameter installs non-AUR package
 ✓ invoke with '-S' parameter fails to install nonexistant package
 ✓ prepare proot environment
 ✓ invoke with '-G' parameter download AUR package source
 ✓ invoke with '-G' parameter download old AUR package source
 1) 0.7-2 with '-G' parameter choose download old AUR package source                                     18/22
2) 0.7-1

 ✓ invoke with '-G' parameter choose download old AUR package source
 - invoke with '-S' parameter install package group (skipped)
 1) noto-fonts '-S' parameter install virtual package                                                    20/22
2) noto-fonts-extra
3) ttf-bitstream-vera
4) ttf-croscore
5) ttf-dejavu
6) ttf-freefont
7) ttf-linux-libertine
8) ttf-droid
9) ttf-liberation
10) ttf-ubuntu-font-family

 ✓ invoke with '-S' parameter install virtual package
 ✓ clean proot environment
 ✓ invoke with '-L' parameter lists installed packages by size

22 tests, 0 failures, 2 skipped

Let me know if there's anything you want to discuss

lectrode avatar Nov 01 '17 02:11 lectrode