Skip to content

Commit

Permalink
revert vec
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryTravis committed Dec 20, 2024
1 parent d1acf61 commit 86f8879
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import project.Errors.Problem_Behavior.Problem_Behavior
import project.Errors.Wrapped_Error.Wrapped_Error
import project.Function.Function
import project.Internal.Array_Like_Helpers
import project.Internal.Ordering_Helpers.Default_Comparator
import project.Math
import project.Meta
import project.Nothing.Nothing
Expand Down
38 changes: 0 additions & 38 deletions test/Base_Tests/src/Data/Vector_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -887,44 +887,6 @@ type_spec suite_builder name alter = suite_builder.group name group_builder->
expected = "abet".utf_8
input.sort . should_equal expected

group_builder.specify "should be comparable for sorting" <|
([1, 2] < [1, 3]) . should_be_true
([1, 2] > [1, 3]) . should_be_false
([1, 2] == [1, 3]) . should_be_false

([1, 3] < [1, 2]) . should_be_false
([1, 3] > [1, 2]) . should_be_true
([1, 3] == [1, 2]) . should_be_false

([1, 2] < [1, 2]) . should_be_false
([1, 2] > [1, 2]) . should_be_false
([1, 2] == [1, 2]) . should_be_true

Ordering.compare [1] [1, 2] . should_equal Ordering.Less
Ordering.compare [] [1, 2] . should_equal Ordering.Less

Ordering.compare [1, 2] [1] . should_equal Ordering.Greater
Ordering.compare [1, 2] [] . should_equal Ordering.Greater

Ordering.compare [1, 2] [1, 2] . should_equal Ordering.Equal

Ordering.compare [] [] . should_equal Ordering.Equal
Ordering.compare [] [1] . should_equal Ordering.Less
Ordering.compare [1] [] . should_equal Ordering.Greater

group_builder.specify "vectors of vectors can be sorted" <|
v = [[1, 2], [3, -4], [1, 1], [3, -5], [3, -2, 4], [3, -2], [1, -1], [1], [], [1, 0]]
expected = [[], [1], [1, -1], [1, 0], [1, 1], [1, 2], [3, -5], [3, -4], [3, -2], [3, -2, 4]]
v.sort . should_equal expected

v2 = [['b', 'c'], ['a', 'c'], ['a', 'b'], ['b', 'a'], ['b', 'b'], ['b', 'd'], ['d', 'b']]
expected2 = [['a', 'b'], ['a', 'c'], ['b', 'a'], ['b', 'b'], ['b', 'c'], ['b', 'd'], ['d', 'b']]
v2.sort . should_equal expected2

v3 = [[[1, 2], [4, 4]], [[1, 2], [3, 5]], [[1, 2], [3, 4]], [[], [3, 4]], [[1], [3, 4]], [[1, 3], [3, 4]], [[], [2, 4]], [[2, 3], [3, 4]], [[2], [3, 4]]]
expected3 = [[[], [2, 4]], [[], [3, 4]], [[1], [3, 4]], [[1, 2], [3, 4]], [[1, 2], [3, 5]], [[1, 2], [4, 4]], [[1, 3], [3, 4]], [[2], [3, 4]], [[2, 3], [3, 4]]]
v3.sort . should_equal expected3

group_builder.specify "should report only a limited number of warnings for incomparable values" <|
gen x = case (x % 10) of
0 -> Nothing
Expand Down

0 comments on commit 86f8879

Please sign in to comment.