Skip to content

Commit

Permalink
Add another, more subtle, failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjaguarpaw committed Feb 6, 2024
1 parent dbca4b0 commit 2e3b3c0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Test/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,21 @@ testStringArrayAggregateOrderedDistinct = xit "" $ q `selectShouldReturnSorted`
]
sortedData = L.sortBy (Ord.comparing snd) table7data

-- See
--
-- https://github.com/tomjaguarpaw/haskell-opaleye/pull/578#issuecomment-1782638274
testStringArrayAggregateOrderedDistinctDuplicateFields :: Test
testStringArrayAggregateOrderedDistinctDuplicateFields = xit "" $ q `selectShouldReturnSorted` expected
where q =
O.aggregateOrdered
(O.asc (\x -> snd x O..++ snd x))
(PP.p2 (O.arrayAgg, O.distinctAggregator . O.stringAgg . O.sqlString $ ","))
table7Q
expected = [ ( map fst sortedData
, L.intercalate "," $ map NE.head $ NE.group $ map snd sortedData
)
]
sortedData = L.sortBy (Ord.comparing snd) table7data

-- | Using orderAggregate you can apply different orderings to
-- different aggregates.
Expand Down Expand Up @@ -1559,6 +1574,7 @@ main = do
testMultipleAggregateOrdered
testStringArrayAggregateOrdered
testStringArrayAggregateOrderedDistinct
testStringArrayAggregateOrderedDistinctDuplicateFields
testDistinctAndAggregate
testDoubleAggregate
testSetAggregate
Expand Down

0 comments on commit 2e3b3c0

Please sign in to comment.