-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds Dynamic.sort & improves output of failing dynamic tests (#…
…1411) * feat: Adds Dynamic.sort * test: Adds tests for Dynamic.sort * refactor: Makes dynamic test handler display diff of expected vs actual instead of displaying "true" : "true" * test: Removes complex implementation of list-equal-unordered Replaces it with sort + equal. While this is less "correct", having complex untested functions within test files is undesirable. This implementation is "good enough" for lists of integers.
- Loading branch information
Showing
4 changed files
with
61 additions
and
29 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(load-and-use Test) | ||
|
||
(deftest test | ||
(assert-dynamic-equal test | ||
'(1 2 3 3 4) | ||
(Dynamic.sort '(3 4 3 1 2) <) | ||
"Dynamic.sort sorts from lower to higher") | ||
|
||
(assert-dynamic-equal test | ||
'(4 3 3 2 1) | ||
(Dynamic.sort '(3 4 3 1 2) >) | ||
"Dynamic.sort sorts from higher to lower") | ||
|
||
(assert-dynamic-equal test | ||
'("one" "four" "three" "two---") | ||
(Dynamic.sort '("one" "two---" "three" "four") | ||
(fn [a b] | ||
(< (String.length a) (String.length b)))) | ||
"Dynamic.sort sorts using predicate")) | ||
|