Commit Graph

102 Commits

Author SHA1 Message Date
Tom Alexander
a61807d84c
Add parser support for select/any/none. 2020-06-07 17:06:14 -04:00
Tom Alexander
84c07b262c
Add a test for the select helper. 2020-06-07 16:50:11 -04:00
Tom Alexander
417466d17d
Implement the first and last helpers. 2020-06-07 15:16:39 -04:00
Tom Alexander
fdecdcb53b
Implemented the sep helper. 2020-06-07 15:09:37 -04:00
Tom Alexander
3ef2facc92
Expanding the sep helpers test. 2020-06-07 14:07:32 -04:00
Tom Alexander
bb658284e6
Add a test for the sep helper. 2020-06-07 14:01:58 -04:00
Tom Alexander
865cba6f4e
Add a test proving that renamed variables are still equal, so its not just based on path. 2020-06-07 01:15:45 -04:00
Tom Alexander
4dee230780
Add some test cases for comparing equality on reference parameters. 2020-06-07 01:11:40 -04:00
Tom Alexander
917da5a073
Put IntoContextElement everywhere. It compiles again. 2020-05-30 17:50:27 -04:00
Tom Alexander
3352b777ae
Factor out the parsing of partial template names into its own parser for reuse as an rvalue. 2020-05-30 15:45:44 -04:00
Tom Alexander
4932a4bb6f
Add tests for reference parameters. 2020-05-30 15:20:54 -04:00
Tom Alexander
e7c05f597f
Add a test proving exists does not support parameters. 2020-05-30 14:42:34 -04:00
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
a6641d9c72
Add a template to dump the parameters to a custom helper. 2020-05-23 14:28:21 -04:00
Tom Alexander
5ddeeac966
minor cleanup. 2020-05-17 21:21:26 -04:00
Tom Alexander
52ba4fd0a3
Only run each command once in the compliance test suite. 2020-05-17 16:40:23 -04:00
Tom Alexander
a33b46661e
Add a script to run a single test to make development easier since I often want to focus on one test at a time. 2020-05-17 16:32:16 -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