diff --git a/js/test_cases/helpers_eq/README.md b/js/test_cases/helpers_eq/README.md index 584c2f5..42d393a 100644 --- a/js/test_cases/helpers_eq/README.md +++ b/js/test_cases/helpers_eq/README.md @@ -1,5 +1,10 @@ Without a key parameter, neither the main block nor the else block is rendered. -Without a value parameter, it probably uses "null" but I haven't yet confirmed that with additional testing. Potentially could also just be making all falsey values equal. - Literal values work in both keys and values. + +Can't Walk Theory +----------------- + +Assuming a missing value = cantwalk and a non-existent key = cantwalk then their equality makes sense. + +The null tests have proven that absent parameters and missing values do not equal null and therefore it is not just making all falsey values equal. diff --git a/js/test_cases/helpers_eq/input1.json b/js/test_cases/helpers_eq/input1.json index 0ed8d16..ece58d2 100644 --- a/js/test_cases/helpers_eq/input1.json +++ b/js/test_cases/helpers_eq/input1.json @@ -2,5 +2,6 @@ "str": "master", "int": 7, "alpha": 21, - "beta": "21" + "beta": "21", + "null": null } diff --git a/js/test_cases/helpers_eq/main.dust b/js/test_cases/helpers_eq/main.dust index 3d2c60b..8126b32 100644 --- a/js/test_cases/helpers_eq/main.dust +++ b/js/test_cases/helpers_eq/main.dust @@ -13,3 +13,6 @@ beta is {beta}{~n} {@eq key=alpha}missing value is true{:else}missing value is false{/eq}{~n} {@eq key=gamma}missing value and non-existent key is true{:else}missing value and non-existent key is false{/eq}{~n} {@eq key="master" value="master"}"master" is equal to "master"{:else}"master" does not equal "master"{/eq}{~n} +{@eq key=null}null equals a missing value{:else}null does not equal a missing value{/eq}{~n} +{@eq key=null value=gamma}null equals a non-existent value{:else}null does not equal a non-existent value{/eq}{~n} +{@eq}no parameters is true{:else}no parameters if false{/eq}{~n}