Commit Graph

82 Commits

Author SHA1 Message Date
Tom Alexander
eb0eb8d4ca
Add priority tests for the other block types except helpers since I do not yet have a helper implemented that sets a value. 2020-05-30 13:47:13 -04:00
Tom Alexander
f04e84dc31
Attempted to move section over to the section-specific new breadcrumbs function.
I think the problem is, the index context needs to be a higher priority than the new context element, but when referencing data with `{.}` the new context element needs to take priority. I could either combine entries in the context tree so that variables like $idx and $len live side-by-side with real context elements, or try to implement a way to skip over index context elements when walking up the tree.
2020-05-25 23:28:49 -04:00
Tom Alexander
79f52ecdee
Add test for priorities while looping and split the new_breadcrumbs function into two separate new_breadcrumbs functions because sections and partials have different orderings. 2020-05-25 22:50:10 -04:00
Tom Alexander
0ca17e0885
Add tests that prove that the priority between explicit contexts and parameters varies across sections and partials. 2020-05-25 20:23:10 -04:00
Tom Alexander
5b1e3c5fb0
Had to sort the input to the explicit_context_setting test because dustjs leaves the original order but serde_json sorts the keys. 2020-05-25 19:30:30 -04:00
Tom Alexander
25eb9b10a0
I did it backwards, I needed to use the explicit context from the block, not the inline partial. 2020-05-25 19:24:49 -04:00
Tom Alexander
400602124e
Added tests proving that the explicit context is evaluated using the global context of the partial containing the block (NOT the inline partial, which is where the explicit context is written). 2020-05-25 17:53:04 -04:00
Tom Alexander
4ce0899279
Expand the explicit context setting test to prove that injected_context gets inserted AFTER the current context when an explicit context is used. 2020-05-25 16:21:25 -04:00
Tom Alexander
4a21ae5af3
Add tests for explicit context setting that check failure conditions and implement a helper function to generate a new breadcrumb stack. 2020-05-25 15:40:42 -04:00
Tom Alexander
1152ff9974
Greatly expand the explicit_context_setting test.
Turns out explicit context setting works in a lot more places than the official dustjs pages indicate. Also some things don't make much sense (like setting it on a block works but not on an inline partial).
2020-05-24 18:16:16 -04:00
Tom Alexander
e27ab16e06
Add a test for explicit context setting. 2020-05-24 17:19:34 -04:00
Tom Alexander
e0fe7475c5
Add a single element array test for idx_and_len.
This test is mostly because I am currently turning truthy values into single element arrays during render, so I need to make sure idx and len and not being set for non-array iteration.
2020-05-24 15:29:14 -04:00
Tom Alexander
9925802ae9
Add .$idx to nested section test. 2020-05-24 15:25:17 -04:00
Tom Alexander
93adaa518d
Add a test for $idx and $len inside nested sections. 2020-05-24 15:22:12 -04:00
Tom Alexander
abf251c68d
Add a test for $idx and $len. 2020-05-24 15:22:10 -04:00
Tom Alexander
1ad9753845
Add an ignored test for type casting.
I think in order to support type casting in a generic fashion so that custom non-json types can be used, I'll need to push the implementation of helpers off into the traits instead of handling it in the renderer. This is a larger undertaking than I was planning on starting at this very moment, so I'm going to leave this test disabled and move on to a couple smaller tasks I wanted to knock out before starting implementation on custom helpers.
2020-05-24 13:05:34 -04:00
Tom Alexander
533ea96d4f
Add a test for literal string blocks. 2020-05-23 23:32:13 -04:00
Tom Alexander
6e8c7621f1
It seems paths with a leading dot restrict the scope the below the current context. 2020-05-23 23:06:04 -04:00
Tom Alexander
da4ef1a8c8
Remove the headers to the dust helper tests because they were misleading. 2020-05-23 22:41:12 -04:00
Tom Alexander
96e8dd63a7
Dustjs appears to have an output limit of 65536 characters which was breaking the string test, so I split it in two. 2020-05-23 22:23:54 -04:00
Tom Alexander
71378ed37d
Fix a bug w.r.t. quoting and escaping boolean values with filters. 2020-05-23 19:34:38 -04:00
Tom Alexander
bd7866e973
Implement encodeURIComponent filter. 2020-05-23 19:10:02 -04:00
Tom Alexander
46d4f50410
Implement the encodeURI filter. 2020-05-23 19:06:09 -04:00
Tom Alexander
8d2728a767
Implement javascript string escaping. 2020-05-23 18:40:09 -04:00
Tom Alexander
f3fef17d4b
I was wrong, html escape filter is appended even if an html escape filter is already there. 2020-05-23 18:18:59 -04:00
Tom Alexander
e22bffd2ba
Implemented the json stringify and parse filters. 2020-05-23 18:14:23 -04:00
Tom Alexander
624c83b680
Automatically appending the html escape filter on the renderer side. 2020-05-23 17:57:19 -04:00
Tom Alexander
6a9fe9e1be
Beginning of applying filters for json types. Currently only supports html escaping. 2020-05-23 17:23:48 -04:00
Tom Alexander
34c8d24a69
Adding to the manual array test. 2020-05-23 16:07:24 -04:00
Tom Alexander
894da51916
Adding a manually written filters test for more specific testing.
The generated one is more for brute forcing compliance.
2020-05-23 16:04:36 -04:00
Tom Alexander
c81a0c5001
Add tests for the other json types. 2020-05-23 15:58:12 -04:00
Tom Alexander
a0136ea62e
Add a generated test invoking all the filters except jp. 2020-05-23 15:52:31 -04:00
Tom Alexander
74c83ef374
Adding a basic dynamic partials test. 2020-05-17 16:07:11 -04:00
Tom Alexander
054480b797
First stab at fixing the error, not a full success. 2020-05-16 21:30:51 -04:00
Tom Alexander
ce8b73f87a
Implement less than or equals. 2020-05-16 19:06:40 -04:00
Tom Alexander
30b7324049
Implement less-than. 2020-05-16 19:05:03 -04:00
Tom Alexander
62cd73f9c9
Initial attempt at implementation, tests not working. 2020-05-16 18:28:23 -04:00
Tom Alexander
0cfe67311e
Comment out the unicode literals test because unicode breaks nom.
Will have to write my own parsers to handle unicode.
2020-05-16 18:21:10 -04:00
Tom Alexander
7126e83d9a
Added tests for non-congruous arrays. 2020-05-16 17:53:57 -04:00
Tom Alexander
0f90fa2c7e
Add support for ignoring tests by prefixing their name with an underscore. 2020-05-16 16:46:39 -04:00
Tom Alexander
6758d515f1
Have greater than helper very close to correct. Just need to make it compare arrays of scalars. 2020-05-16 16:24:36 -04:00
Tom Alexander
48e35c54bb
Add tests for less than and less than or equal to. 2020-05-16 15:51:40 -04:00
Tom Alexander
02abee1c53
Add a test for gte. 2020-05-16 15:45:57 -04:00
Tom Alexander
d751df6fd5
Add tests for copied values. 2020-05-16 14:48:04 -04:00
Tom Alexander
6dbeb77a28
Add arrays to all helpers tests. 2020-05-16 14:19:56 -04:00
Tom Alexander
71e6da39ee
Add a test for boolean comparison. 2020-05-16 13:46:31 -04:00
Tom Alexander
8a44bc6fd9
Add greater-than-specific tests to investigate string ordering. 2020-05-16 13:06:52 -04:00
Tom Alexander
f390c05a4c
Finished porting over the equality test to greater than. 2020-05-16 13:00:09 -04:00
Tom Alexander
196740ae34
Starting the greater than helper tests. 2020-05-16 12:51:27 -04:00
Tom Alexander
94cedef3ef
Added a test for not equals which is roughly a copy of the equals test. 2020-05-16 12:23:08 -04:00