mirror of
https://github.com/enso-org/enso.git
synced 2024-11-22 22:10:15 +03:00
parent
8f30fcf376
commit
da0dc253cb
@ -410,7 +410,7 @@ prepare_order_by : Vector -> Text | Vector Text | Sort_Column_Selector -> Proble
|
||||
prepare_order_by internal_columns column_selectors problem_builder =
|
||||
selected_elements = case column_selectors of
|
||||
_ : Text ->
|
||||
unified_name_selectors = [Sort_Column.Name unified_name_selectors]
|
||||
unified_name_selectors = [Sort_Column.Name column_selectors]
|
||||
select_columns_by_name internal_columns unified_name_selectors Text_Matcher.Case_Sensitive problem_builder name_extractor=(_.name)
|
||||
_ : Vector ->
|
||||
unified_name_selectors = column_selectors.map (Sort_Column.Name _)
|
||||
|
@ -35,6 +35,11 @@ spec setup =
|
||||
t1.at "alpha" . to_vector . should_equal [0, 1, 2, 3]
|
||||
t1.at "gamma" . to_vector . should_equal [4, 3, 2, 1]
|
||||
|
||||
Test.specify "should work with single column name" <|
|
||||
t1 = table.order_by "alpha"
|
||||
t1.at "alpha" . to_vector . should_equal [0, 1, 2, 3]
|
||||
t1.at "gamma" . to_vector . should_equal [4, 3, 2, 1]
|
||||
|
||||
t2 = table.order_by (Sort_Column_Selector.By_Index [1, Sort_Column.Index -8 Sort_Direction.Descending])
|
||||
t2.at "beta" . to_vector . should_equal ["a", "a", "b", "b"]
|
||||
t2.at "gamma" . to_vector . should_equal [3, 1, 4, 2]
|
||||
|
Loading…
Reference in New Issue
Block a user