test-apt-cli-search 1000 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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'
  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. # output is sorted and search word finds both package
  33. testequal "bar/testing 2.0 i386
  34. $DESCR2
  35. foo/unstable 1.0 all
  36. $DESCR
  37. " apt search -qq aabbcc