test-apt-cli-search 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture "i386"
  7. if [ ! -x ${BUILDDIRECTORY}/apt ]; then
  8. msgmsg "No ${BUILDDIRECTORY}/apt"
  9. msgskip
  10. exit 0
  11. fi
  12. DESCR='Some description that has a unusual word xxyyzz and aabbcc and a UPPERCASE'
  13. DESCR2='Some other description with the unusual aabbcc only'
  14. insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR"
  15. insertpackage 'testing' 'bar' 'i386' '2.0' '' '' "$DESCR2"
  16. setupaptarchive
  17. APTARCHIVE=$(readlink -f ./aptarchive)
  18. # with OP progress
  19. testequal "Sorting...
  20. Full Text Search...
  21. foo/unstable 1.0 all
  22. $DESCR
  23. " apt search xxyyzz
  24. # without op progress
  25. testequal "foo/unstable 1.0 all
  26. $DESCR
  27. " apt search -qq xxyyzz
  28. # search with multiple words is a AND search
  29. testequal "foo/unstable 1.0 all
  30. $DESCR
  31. " apt search -qq aabbcc xxyyzz
  32. # search is not case-sensitive by default
  33. testequal "foo/unstable 1.0 all
  34. $DESCR
  35. " apt search -qq uppercase
  36. # output is sorted and search word finds both package
  37. testequal "bar/testing 2.0 i386
  38. $DESCR2
  39. foo/unstable 1.0 all
  40. $DESCR
  41. " apt search -qq aabbcc