1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00
Commit Graph

101 Commits

Author SHA1 Message Date
Cameron Fischer
65347ae858
Fixed join filter operator to never returns null (#4396)
If the operator were passed an empty list, it would return null
which could cause some proceeding operators to crash.
2020-04-14 17:49:38 +01:00
Mario Pietsch
db13e49724
More listops tests (#4409)
* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* make eslint happy

* add more listops tests

* new listops filter tests

* remove new-line

* make eslint happier.

* revert eslint settings
2020-01-31 14:09:06 +00:00
Mario Pietsch
3aa5198c3e Update tests (#4392)
add 3 new tiddlers, add 1 "enlist" test, fix all tests that failed, because 3 new tiddlers where added. stopped ESLint to complain about global vars, fix some mixed-tab-space indent typos.
2019-12-19 13:38:09 +00:00
Jeremy Ruston
17711657b6 Add then and else operators
Fixes #4147
2019-08-02 14:27:58 +01:00
Jeremy Ruston
3afaa9de9a Add support for anchored searches 2019-07-31 21:36:12 +01:00
Jeremy Ruston
5faae2547d Add "match" operator for string comparison
Fixes #4130
2019-07-31 09:11:12 +01:00
Jeremy Ruston
269fa5313f Fix for index ordering issue
Fixes #4082

This version removes selective updating of the tag index, instead completely clearing the index on each update. I'm investigating restoring that optimisation.
2019-07-28 16:39:34 +01:00
Jeremy Ruston
cbd07465f3 Fix test rig shadow tiddler behaviour
The test rig previously used a simplified implementation of shadow tiddlers which broke with the new indexing engine. There was also a problem that made that even if indexers were disabled they were still initialised.

This PR fixes both problems, in preparation for fixing #4082
2019-07-16 16:53:37 +01:00
Jeremy Ruston
c8d6f3b681 Fix tests for changes to split operator
We now retain any blank strings
2019-06-21 10:36:53 +01:00
Jeremy Ruston
630a0ecf9e Remove test for concat operator 2019-06-13 16:55:55 +01:00
Jeremy Ruston
dd7837d164 Fix issue with allafter operator
Fixes #3962
2019-06-11 09:38:14 +01:00
Jeremy Ruston
a8f70b08a8
Add indexes to the wiki store to improve performance (#3951)
* First pass at modular wiki indexes

An exploratory experiment

* Fix tests

* Faster checking for existence of index methods

We don't really need to check the type

* Use the index for the has operator

* Fix typo

* Move iterator index methods into indexer modules

Now boot.js doesn't know the core indexers

* Fix up the other iterator index functions

* Fix crash with missing index branch

* Limit the field indexer to values less than 128 characters

* Fallback to the old manual scan if the index method returns null
* Sadly, we can no longe re-use the field indexer to accelerate the `has` operator, because the index now omits tiddlers that have field values longer than the limit

Still need to make the index configuration exposed somehow

* Rearrange tests so that we can test with and without indexers

We also need to expose the list of enabled indexers as a config option

* Test the field indexer with different length fields

So that we test the indexed and non-indexed codepaths
2019-05-24 21:07:37 +01:00
Jermolene
9d7d3fefa0 Split operator: Remove empty strings when splitting
See the discussion on 9b2d527; thanks @kookma
2019-02-08 15:59:07 +00:00
Jermolene
adb07ccba0 Add a test for all filter with blank operand
Actually quite a useful way to get all of the tiddlers that were passed into the filter.
2019-02-07 17:59:12 +00:00
Jermolene
158f96a207 Fix split operator testcase 2019-02-07 12:48:23 +00:00
Jermolene
dc29acd656 Fixed bug with split operator 2019-02-07 12:45:07 +00:00
Jermolene
9b2d52716a Add new string operators: length, join, split, concat etc. 2019-02-07 11:18:53 +00:00
Jermolene
0ea00b59b0 Add numeric maths filter operators
There are other ways we could add maths to TW5 (including @EvanBalster's awesome https://github.com/EvanBalster/TiddlyWikiFormula) but the approach here has the merit of simplicity because it reuses the existing filter evaluation mechanism. That means that it's not ordinary "2+2" maths, it's a unique list processing language...

Docs to come

Fixes #254
2019-02-06 14:19:55 +00:00
Rob Hoelz
d8b291bc04 Fix search method for search tokens spread across fields (#3641)
* Fix search method for search tokens spread across fields

Addresses GH #3636, which reports that if you're searching for "test
body", and "test" only appears in the title field, and "body" only appears
in the text field, 5.1.18's search method won't yield that tiddler as a
result, which appears to be a regression from the 5.1.17 behavior

* Add test for searching for multiple tokens across fields

Verifies GH #3636:

> If I create a tiddler in the empty edition with the title "Test tiddler" and content "Body content", searching the wiki for "test body" yields no results under either "title matches" or "all matches". Searching for either word individually turns up "Test tiddler", and repeating this in an empty wiki I created from the 5.1.17 tag causes "Test tiddler" to show up under "all matches".
2018-12-17 11:19:48 +00:00
Jeremy Ruston
09330968cc
New "else" prefix for filters (#3558)
* Experimental "else" prefix for filters

See #3557

* Docs updates for "else" filter runs
2018-11-20 13:29:44 +00:00
Jeremy Ruston
6dcdc2049a
Enhance search operator (#3502)
* Enhance search operator

* Add support for searching all fields

and also searching all fields except nominated fields.

* Docs tweaks

Thanks @pmario

* Error message improvements

* Improve error message formatting
2018-10-30 17:39:18 +00:00
Jermolene
aa417fe899 Add new "lookup" filter 2017-09-07 15:48:00 +01:00
Tobias Beer
6085936475 Introduce "field" suffix for "has" filter operator (#2066)
* has:field — tested & documented

allows to test whether a field exists

* fixed inverted condition

* added from version to docs
2017-02-22 12:13:59 +00:00
Tobias Beer
ef3e44eb48 rename suffix each:list to each_list-item
based on #1422, improves readability of the filter expression

tests passed
2015-11-13 11:07:24 +01:00
Tobias Beer
f684a6beb0 fixed helper function and added tests
tests: ok
2015-10-08 14:07:00 +02:00
Jermolene
b69dff861d Fix tests for c33a17a475 2015-03-11 21:58:45 +00:00
Tobias Beer
b40da093af added tests to tagging for changes in #1378
using a single test-filters.js is (becoming) a pain... I'd rather have a
single test file per filter / module / function
2015-01-27 18:20:03 +01:00
Jermolene
9e167dc468 Adjust tests for system tiddler linking (#1103) 2015-01-11 16:44:51 +00:00
Jermolene
f4fff7a330 Add new "regexp" filter operator
Fixes #762
2014-09-09 15:57:41 +01:00
Jermolene
be040ea8a2 Add support for variable filter operands
Fixes #583
2014-07-25 15:26:44 +01:00
Jermolene
d5094463f4 Temporarily revoke sorting tests
localeCompare seems to behave differently in the browser and under
Node.js, making it hard to get the tests consistent
2014-05-16 14:46:55 +01:00
Jermolene
e83759e86d Add "before" and "after" filter operators
Fixes #357 by adding new “before” and “after” filter operators.
2014-05-12 15:16:44 +01:00
Jermolene
f5bd99fa73 Fix tests for 385c7e207c 2014-04-27 21:58:41 +01:00
Jermolene
b7f674c51a First pass at refactoring filter execution
This is the beginning of addressing #523.
2014-04-03 20:49:16 +01:00
Jermolene
9de17aa206 Make shadowTiddlers, pluginTiddlers and pluginInfo be private to the Wiki object constructor 2014-03-17 10:50:18 +00:00
Jermolene
9ded88105b Update test of tagging filter to reflect 0d7c4ae6c7 2014-03-11 15:53:41 +00:00
Simon Baird
6ed8a7624d Also fix timezone related eachday test failure
In some timezones, (eg GMT+6) the modified timestamps for the
'TiddlerOne' and 'Tiddler Three' test tiddlers were actually on
the same day. This was causing the 'eachday' filter test to fail.

Similar to the fix in commit 8487221, this just adjusts the
timestamp to ensure the test passes in any timezone.
2014-01-31 00:56:25 +10:00
Simon Baird
8487221654 Fix timezone related sameday filter test failure
In certain timezones, 201304151312 UTC is not actually the same day
as 201304152219 any 201304151756. This was causing the test for the
'sameday' filter operator to fail. (I'm in GMT+10).

This is a quick-fix. I've just adjusted the timestamps to be close
together so they will be same day no matter what timezone you're in.
2014-01-30 18:24:05 +10:00
Jermolene
02d3861d7d Tests for the new filter operators 2014-01-25 17:44:14 +00:00
Jermolene
8d37219545 Add some tests 2014-01-24 19:15:34 +00:00
David Johnston
154d5f316b Added test for !limit (not limit)
Added test for !limit (not limit) to ensure bug change works
2013-10-01 11:27:26 +01:00
David Johnston
904a079432 Variable name corrected. 2013-09-22 21:17:46 +01:00
David Johnston
8127662f77 Tests added for the Next and Previous Filters. 2013-09-22 10:02:40 +01:00
Jeremy Ruston
f0d459c5c5 Fix expected test results for eachday filter operator
The tiddler "a fourth tiddler" doesn't have a modified date, and so
shouldn't appear
2013-09-21 10:07:49 +01:00
Jeremy Ruston
4fb6836481 Add an untagged filter operator and sidebar tab 2013-09-14 16:28:46 +01:00
Jeremy Ruston
a9a2ae2223 Add sorting by tiddler lists
The tag and tagging filters now sort their results by the list field of
the tag, if present
2013-08-08 17:39:34 +01:00
Jeremy Ruston
83ea953a1d Switch the story list over to using the new list field 2013-08-07 17:54:27 +01:00
Jeremy Ruston
87fa4db89b Update tests for the new list field
First step is to add a tiddler with a list field
2013-08-07 16:06:46 +01:00
Jeremy Ruston
bf4216f3ac Don't count references to shadow tiddlers as missing tiddlers 2013-05-31 17:53:11 +01:00
Jeremy Ruston
5d43040663 Tests for the new filter operators 2013-05-27 17:59:47 +01:00
Jeremy Ruston
0cf5dc699e Refactor the filter mechanism
Long overdue rewrite to make it simpler, and break the filter operators
out into individual modules.
2013-05-25 17:26:22 +01:00