-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deterministic template slice functions (#30)
* Deterministic order of TmplObjectArray function Template function objectArray did not order values deterministic. This changes ensures this by ordering after all values are parsed. The test assertion is changed to `assert.Equal` that matches the values directly instead of `assert.ElementsMatch` that does not take order into account. With this change the "nil input" test case did not match expectatations. This is due to `assert.ElementsMatch` accepting a nil value to match an empty slice. This means the output of the function have not changed, but our assertion has gotten more strict. Related to #29 * Deterministic order of TmplGetFiles function Template function 'getFiles' did not order files deterministic. This change ensures this by ordering all files by name. Related to #29 * Deterministic order of TmplArray function Template function array did not order values deterministic. This change ensures this for string arrays. We have no trivial way of ordering unknown types so this is omitted. I removed some code handling objects in the input. The function is not intended to handle these cases. TmplObjectArray should be used instead. Related to #29
- Loading branch information
1 parent
da3d85b
commit 465dfed
Showing
2 changed files
with
204 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters