summaryrefslogtreecommitdiff
path: root/test/lib-blacklist-test.sh
AgeCommit message (Collapse)Author
2017-10-14blacklist get-rep: re-implement to query repos instead of blacklist.txtIsaac David
Rationale: https://lists.parabola.nu/pipermail/dev/2017-October/005936.html This makes get-rep a general-purpose tool for finding replacements and providers of any package, not just blacklisted-ones. It works equally well reading from full blacklist.txt lines, just pkgname lines, and unwittingly; a single line with many pkgnames. Some caveats for further discussion: - This changes behavior from showing just one replacement/provider to _all_ replacements and providers (including pkgname itself) in the repos. - By "repos" I mean the repos the executing machine is configured to access. This could be changed in the future with `expac --config` if more package databases are desired (e.g. different architecture). - Results are shown using the "repo/pkgname ..." format rather than just "pkgname ...". I think this makes the program more useful. - Results aren't reordered to ensure that the first provider of pkgname is pkgname itself. Order will be as expected otherwise, by virtue of expac parsing repos in order.
2017-10-13blacklist test: distinguish between empty string and empty line properIsaac David
Plenty of functions in libreblacklist are expected to print empty lines, so as to signify that the archpkg at that line in the input has an empty accompanying field. Printing no newline and skipping to the next archpkg is therefore a bug; one that would pass unnoticed by current tests. This is because command substitution removes trailing whitespace. I.e. the following is true: [[ $(libreblacklist get-rep <<<'') == $(libreblacklist get-rep <<<$'\n') ]] Process substitution and pipes preserve whitespace, but only the latter work with #!/usr/bin/env roundup, so we use that.
2017-10-09blacklist: implement `get-url` function from `reference` and `id` fieldsIsaac David
The blacklist allows referring to a number of trusted bug trackers to complement the information given in the reason field. However, maintainable shorthand identifiers are used instead of full URLs. Printing the latter based on the former is the job of this new functionality. This also introduces corresponding test cases and l10n strings (together with translations for the `es` locale).
2017-10-07blacklist.sh: update `normalize` and `get-reason` to reflect blacklist.txtIsaac David
the blacklist has had a couple extra fields (ref, id) for some time, but `libreblacklist` was never made aware of the change. this updates test/lib-blacklist-test.sh for the same reason, and adds a test for comment stripping under `it_normalizes_correctly()`.
2017-04-11test/: Tidy before()/after() definitions.Luke Shumaker
2014-10-01blacklist test: clean upLuke Shumaker
2014-02-02test: `! true` doesn't trip `set -e`, do subshell magicLuke Shumaker
2013-11-02test: set LC_ALL instead of LANGLuke Shumaker
2013-10-26test: blacklist: shorten a couple of test namesLuke Shumaker
2013-09-30test-common.sh: add an empty() routine to check if a file is empty, use itLuke Shumaker
2013-09-12test: tidy up, make everything use test-common.shLuke Shumaker
2013-09-11libreblacklist: Fix a bug in the -h flag, adjust the unit test to catch it.Luke Shumaker
2013-09-11test: set LANG=C when parsing the outputLuke Shumaker
2013-06-08libreblacklist: fix a few bugsLuke Shumaker
- set -e didn't work in blacklist-update when followed by || - it prompted before overwriting the local blacklist
2013-06-05Add tests for the libreblacklist help system, make them pass.Luke Shumaker
2013-06-05Fix tests for networks that have a host on them named "phony".Luke Shumaker
I was using "http://phony" as a URL that would fail to be retrieved. Well, I'm currently on a network (Chick-fil-A Wifi) that returns a web search for unknown hostnames. So, now I use "phony://example.com".
2013-06-05reorganize the tests a bitLuke Shumaker