diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/S3_Path.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/S3_Path.enso index 283b53110376..87f01c393d48 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/S3_Path.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/S3_Path.enso @@ -158,7 +158,7 @@ type Decomposed_S3_Path Decomposed_S3_Path.Value new_parts self.go_to_root type S3_Path_Comparator - compare x y = Ordering.compare [x.bucket, x.key] [y.bucket, y.key] + compare x y = Ordering.compare x.bucket y.bucket . and_then Ordering.compare x.key y.key hash x = S3_Path_Comparator.hash_builtin x hash_builtin x = @Builtin_Method "Default_Comparator.hash_builtin" diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3_File.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3_File.enso index ff4080917bf4..890b1c8cf659 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3_File.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3_File.enso @@ -187,7 +187,7 @@ type S3_File S3_File.Value (S3_Path.Value bucket key) self.credentials files = pair.second . map key-> S3_File.Value (S3_Path.Value bucket key) self.credentials - sub_folders + files . sort on=.s3_path + (sub_folders + files) . sort on=(x-> x.s3_path) ## ALIAS load bytes, open bytes ICON data_input diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso index 63cb3d0e8efa..c170b5417c0b 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso @@ -4,7 +4,6 @@ import project.Data.Filter_Condition.Filter_Condition import project.Data.Index_Sub_Range.Index_Sub_Range import project.Data.List.List import project.Data.Numbers.Integer -import project.Data.Ordering.Ordering import project.Data.Pair.Pair import project.Data.Range.Range import project.Data.Sort_Direction.Sort_Direction @@ -1565,24 +1564,3 @@ type No_Wrap ## PRIVATE Wrapped_Error.from (that : Map_Error) = Wrapped_Error.Value that that.inner_error - -type Vector_Comparator - compare x y = - min_length = x.length.min y.length - when_prefixes_equal = - ## At this point, if the vectors are the same length, then they are - identical; otherwise, the shorter one is lesser. - if x.length == y.length then Ordering.Equal else - Ordering.compare x.length y.length - go i = - if i >= min_length then when_prefixes_equal else - x_elem = x.at i - y_elem = y.at i - Ordering.compare x_elem y_elem . and_then <| - @Tail_Call go (i + 1) - k = go 0 - k - - hash x = Default_Comparator.hash_builtin x - -Comparable.from (that : Vector) = Comparable.new that Vector_Comparator diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Internal/Enso_Path.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Internal/Enso_Path.enso index f658380a8a24..1aca5bd991be 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Internal/Enso_Path.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Internal/Enso_Path.enso @@ -2,6 +2,7 @@ private import project.Data.Ordering.Comparable import project.Data.Ordering.Ordering +import project.Data.Ordering.Vector_Lexicographic_Order import project.Data.Text.Text import project.Data.Vector.Vector import project.Enso_Cloud.Enso_File.Enso_File @@ -77,7 +78,7 @@ normalize segments = @Tail_Call normalize new_segments type Enso_Path_Comparator - compare x y = Ordering.compare x.path_segments y.path_segments + compare x y = Vector_Lexicographic_Order.compare x.path_segments y.path_segments hash x = Enso_Path_Comparator.hash_builtin x hash_builtin x = @Builtin_Method "Default_Comparator.hash_builtin" diff --git a/test/AWS_Tests/src/S3_Spec.enso b/test/AWS_Tests/src/S3_Spec.enso index 45f3e684c76d..40235807351d 100644 --- a/test/AWS_Tests/src/S3_Spec.enso +++ b/test/AWS_Tests/src/S3_Spec.enso @@ -264,8 +264,7 @@ add_specs suite_builder = group_builder.specify "list should sort its output" <| r = root.list r.should_be_a Vector - r . should_equal (r.sort on=.s3_path) - r . should_equal (r.sort on=(x-> x.s3_path.to_text)) + r . should_equal (r.sort on=(x-> x.path)) group_builder.specify "will fail if no credentials are provided and no Default credentials are available" pending=(if AWS_Credential.is_default_credential_available then "Default AWS credentials are defined in the environment and this test has no way of overriding them, so it is impossible to test this scenario in such environment.") <| root_without_credentials = S3_File.new "s3://"+bucket_name+"/" diff --git a/test/Base_Tests/src/Network/Enso_Cloud/Enso_File_Spec.enso b/test/Base_Tests/src/Network/Enso_Cloud/Enso_File_Spec.enso index 68265a0281eb..d2618fed660f 100644 --- a/test/Base_Tests/src/Network/Enso_Cloud/Enso_File_Spec.enso +++ b/test/Base_Tests/src/Network/Enso_Cloud/Enso_File_Spec.enso @@ -45,7 +45,6 @@ add_specs suite_builder setup:Cloud_Tests_Setup = suite_builder.group "Enso Clou r = Enso_File.home.list r.should_be_a Vector r . should_equal (r.sort on=.path) - r . should_equal (r.sort on=.enso_path) group_builder.specify "should allow to create and delete a directory" <| my_name = "my_test_dir-" + (Random.uuid.take 5)