112 Commits (master)

Author SHA1 Message Date
Tom Alexander e54e20d254
Add a test case for casting booleans to numbers. 4 years ago
Tom Alexander 5dff03bb37
Add a test case for type casting to the equality helper tests. 4 years ago
Tom Alexander 648ae5dfdb
Turns out I was wrong, the @size helper attempts to cast to a number regardless of the input and it uses that. Fixed the test. 4 years ago
Tom Alexander e70f397545
First attempt at fixing by reading all indirect references containing a reference to a single value as the original value is a failure. Turns out the @size helper treats numeric types in indirect references differently. 4 years ago
Tom Alexander 716a110d2e
Added some notes about observed behavior and fixed return types for missing/absent keys. 4 years ago
Tom Alexander 1a54e35736
Add tests and a Sizable trait for ContextElement. 4 years ago
Tom Alexander 978bbe6eb3
Implemented float literals for OwnedLiterals, not yet for serde_json. 4 years ago
Tom Alexander 8daa746da6
Initial structure for the perform_math_operation function. 4 years ago
Tom Alexander c5db1cea8f
Add a test case for the math helper and add else blocks to the select test. 4 years ago
Tom Alexander 0fac063c8d
Implemented none and any, but I need to implement early termination. 4 years ago
Tom Alexander a61807d84c
Add parser support for select/any/none. 4 years ago
Tom Alexander 84c07b262c
Add a test for the select helper. 4 years ago
Tom Alexander 417466d17d
Implement the first and last helpers. 4 years ago
Tom Alexander fdecdcb53b
Implemented the sep helper. 4 years ago
Tom Alexander 3ef2facc92
Expanding the sep helpers test. 4 years ago
Tom Alexander bb658284e6
Add a test for the sep helper. 4 years ago
Tom Alexander 865cba6f4e
Add a test proving that renamed variables are still equal, so its not just based on path. 4 years ago
Tom Alexander 4dee230780
Add some test cases for comparing equality on reference parameters. 4 years ago
Tom Alexander 917da5a073
Put IntoContextElement everywhere. It compiles again. 4 years ago
Tom Alexander 3352b777ae
Factor out the parsing of partial template names into its own parser for reuse as an rvalue. 4 years ago
Tom Alexander 4932a4bb6f
Add tests for reference parameters. 4 years ago
Tom Alexander e7c05f597f
Add a test proving exists does not support parameters. 4 years ago
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. 4 years ago
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.
4 years ago
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. 4 years ago
Tom Alexander 0ca17e0885
Add tests that prove that the priority between explicit contexts and parameters varies across sections and partials. 4 years ago
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. 4 years ago
Tom Alexander 25eb9b10a0
I did it backwards, I needed to use the explicit context from the block, not the inline partial. 4 years ago
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). 4 years ago
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. 4 years ago
Tom Alexander 4a21ae5af3
Add tests for explicit context setting that check failure conditions and implement a helper function to generate a new breadcrumb stack. 4 years ago
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).
4 years ago
Tom Alexander e27ab16e06
Add a test for explicit context setting. 4 years ago
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.
4 years ago
Tom Alexander 9925802ae9
Add .$idx to nested section test. 4 years ago
Tom Alexander 93adaa518d
Add a test for $idx and $len inside nested sections. 4 years ago
Tom Alexander abf251c68d
Add a test for $idx and $len. 4 years ago
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.
4 years ago
Tom Alexander 533ea96d4f
Add a test for literal string blocks. 4 years ago
Tom Alexander 6e8c7621f1
It seems paths with a leading dot restrict the scope the below the current context. 4 years ago
Tom Alexander da4ef1a8c8
Remove the headers to the dust helper tests because they were misleading. 4 years ago
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. 4 years ago
Tom Alexander 71378ed37d
Fix a bug w.r.t. quoting and escaping boolean values with filters. 4 years ago
Tom Alexander bd7866e973
Implement encodeURIComponent filter. 4 years ago
Tom Alexander 46d4f50410
Implement the encodeURI filter. 4 years ago
Tom Alexander 8d2728a767
Implement javascript string escaping. 4 years ago
Tom Alexander f3fef17d4b
I was wrong, html escape filter is appended even if an html escape filter is already there. 4 years ago
Tom Alexander e22bffd2ba
Implemented the json stringify and parse filters. 4 years ago
Tom Alexander 624c83b680
Automatically appending the html escape filter on the renderer side. 4 years ago
Tom Alexander 6a9fe9e1be
Beginning of applying filters for json types. Currently only supports html escaping. 4 years ago