Commit Graph

68 Commits (e4a87d12563a17acafe43984624cce5e1c51faf0)

Author SHA1 Message Date
Ben Moon d115e04a95 Add check for IA page existence
We check to make sure that an IA page with the correct ID exists.
2016-05-13 18:28:31 +01:00
Ben Moon dc299832d7 Ensure all invalid aliases are in test results
Only the first alias was showing, we ensure that *all* aliases that fail
the tests are shown.
2016-05-09 18:43:27 +01:00
Ben Moon a85b5352a6 Make ignore test critical 2016-05-09 18:43:27 +01:00
Ben Moon eefe68af55 Add tests for ignored phrases in aliases
Emit a warning if the user defines an alias that contains an ignored
phrase.
2016-05-09 18:43:27 +01:00
Ben Moon 0e1ff0e524 Ensure tests are *fully* alphabetically sorted
Issue with language cheat sheets being lexically sorted under 'l', and
thus being inserted halfway(ish) through the tests. Feexed.
2016-05-09 18:43:27 +01:00
Ben Moon d6785cb5ab Ensure tests are alphabetical
Easier to read and locate cheat sheets when tests are alphabetical.
2016-05-09 18:43:27 +01:00
Ben Moon c2ecd68703 Have tests only check ID rather than all data
We don't need to check the data and it slows down the tests, it is
sufficient to check that it triggered and has the correct ID.
2016-04-29 14:34:49 +01:00
Zach Thompson ce74963b7b Values too?! 2016-04-06 14:57:43 -06:00
Zach Thompson a3fe248ac4 One more each on ref! 2016-04-06 14:35:07 -06:00
Zaahir Moolla 88d49758b6 Merge pull request #2773 from duckduckgo/zt/no-id-name
Remove id/name from Perl modules and tests
2016-03-23 14:23:52 -04:00
Ben Moon b4d861a24d Replace hard-coded max_length with dynamic length 2016-03-19 14:42:59 +00:00
Ben Moon 7f94106afa Replace substitution delimiter with '/'
Highlighting issues!
2016-03-19 13:21:15 +00:00
Ben Moon af67e12223 Display both warnings and errors
Display WARNINGS, FAILURES, or both when reporting test results.
2016-03-19 10:16:20 +00:00
Ben Moon bf3b056862 Update 'val' tests to use appropriate 'val' type
For the particular template used; e.g, 'trn' with 'language'.
2016-03-19 10:16:20 +00:00
Ben Moon c0a64d13be Only check against base name for ID check
So that cheat sheets in folders don't hate on us.
2016-03-19 10:16:20 +00:00
Ben Moon 5c9e825328 Fix handling of arguments
This does two things:

1. Allows multiple cheat sheets to be passed as arguments.

2. As a result of implementing the above, this now allows testing of the
language cheat sheets, which were previously untested.
2016-03-19 10:16:20 +00:00
Ben Moon 2ea1cdc4e2 Improve test phrasing
Hopefully this should be easier to understand for average use!
2016-03-19 10:16:19 +00:00
Ben Moon 62a771f73f Update trailing whitespace tests 2016-03-19 10:16:19 +00:00
Ben Moon db035c8651 Add ID standards test
Ensure ID ends with '_cheat_sheet'
2016-03-19 10:16:19 +00:00
Ben Moon 1c1894d40d Update output to use a 'normalized' amount of dots
To make it read nicer!
2016-03-19 10:16:19 +00:00
Ben Moon 054eeb9ed2 Improve test output
* Do not print 'testing....' for each test

* Color actual test message based on pass/warn/critical

* Report number of failures

* Do not duplicate the initial print message

* Prevent (AFAICS) tests wrapping incorrectly
2016-03-19 10:16:19 +00:00
Ben Moon 3b164ffaf5 Fix valid JSON test
Would use results from previous tests - we don't want that! Would also
fail (completely) if the JSON was invalid.
2016-03-19 10:16:19 +00:00
Ben Moon a40bfc4ade Fix indent
Happy @zachthompson? ;)
2016-03-19 10:16:19 +00:00
Zach Thompson 73d8f72fc0 Remove id/name from Perl modules and tests 2016-03-18 11:49:33 -06:00
Zach Thompson d664839c44 Merge pull request #2723 from duckduckgo/gd/cheatsheets-fix-section-tests
CheatSheets: Fix section tests
2016-03-10 12:23:16 -07:00
Ben Moon 526c363e16 Update test output to show all critical failures
Rather than just one at the end.
2016-03-10 17:49:36 +00:00
Ben Moon 9a343e1e39 Fix assigned categories not being set correctly
Whoops!
2016-03-10 16:45:03 +00:00
Ben Moon 47834bd7d9 Ensure default triggers are always critical 2016-03-10 16:19:34 +00:00
Ben Moon 5f9fa76873 Merge section contents tests 2016-03-10 15:53:41 +00:00
Ben Moon 54d0b7faad Fix remaining section tests
They weren't accounting properly for invalid section values - this fixes
that.
2016-03-10 15:34:14 +00:00
Ben Moon b752d0d893 Remove redundant %order hash
Use %sections with delete to get a hash with the appropriate items.
2016-03-10 15:33:27 +00:00
Zaahir Moolla be7dbb3f63 Merge pull request #2333 from duckduckgo/gd/update-xs-libs
Update use of 'JSON' to 'JSON::MaybeXS'
2016-03-10 10:11:29 -05:00
Ben Moon e81f8f5bdb Move condition assignments into if 2016-03-09 15:29:06 +00:00
Ben Moon 6a45c21e94 Update section tests to report in bulk
I.e, they report all bad sections rather than failing on first one.
2016-03-09 15:17:24 +00:00
Ben Moon e090a9949d Make section tests case-sensitive 2016-03-09 14:56:50 +00:00
Ben Moon 570fcc8146 Make section tests critical 2016-03-09 14:49:29 +00:00
Ben Moon 064f17488c Fix section tests
Anything that didn't contain alpha chars (and thus have something to
lowercase) was being removed entirely from the sections (causing a
warning), this fixes that.
2016-03-09 14:27:15 +00:00
Ben Moon 509f94af2c Update CheatSheetsJSON to use JSON::MaybeXS 2016-03-08 16:35:34 +00:00
Ben Moon c59aece0e1 Combine tests that rely on ID being present 2016-03-07 17:26:03 +00:00
Ben Moon d8ff7c9ec4 Only warn if category not assigned to cheat sheet
For the alias-trigger tests.
2016-03-04 20:56:54 +00:00
Ben Moon 7b9c57d4b6 Remove 'any' trigger test 2016-03-04 19:52:57 +00:00
Ben Moon a487995575 Whitelist 'duckduckgo-syntax' for category tests
I think this is the best option as it is the only case.
2016-03-04 19:06:00 +00:00
Ben Moon 8f8d49b5b2 Add test for aliases against custom triggers
Make sure aliases don't contain custom triggers defined in
'triggers.yaml'.
2016-03-03 20:41:44 +00:00
Ben Moon 2665cc33f0 Add test for triggers in aliases
Ensures aliases do not contain any of the triggers defined in
categories.
2016-03-03 20:26:51 +00:00
Ben Moon 3d192eead4 Update ID file name test
Only use conversion from ID to file name.
2016-03-02 20:06:49 +00:00
Ben Moon 30b501eb0f Update trigger check to use more concise method 2016-03-02 19:37:33 +00:00
Ben Moon cd80f72d73 Update trigger map 2016-03-02 19:27:27 +00:00
Ben Moon a9d402b28f Make use of global %triggers hash 2016-03-02 19:22:38 +00:00
Ben Moon 77a908d514 Add test for valid template type 2016-03-02 18:48:39 +00:00
Ben Moon b6e806f36c Add 're-adding category' test 2016-03-02 18:32:07 +00:00