packages feed

tasty-sugar 2.2.3.1 → 2.2.3.2

raw patch · 7 files changed

+33/−17 lines, 7 filesdep ~tasty-hedgehogPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: tasty-hedgehog

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for tasty-sugar +## 2.2.3.2 -- 2025-12-15++ * Widen tasty-hedgehog constraints to allow earlier v1.3.+ * Internally replace uses of head to assure completeness.+ ## 2.2.3.1 -- 2025-11-01   * Bump constraints for parallel to allow 3.4.* [from Vekhir].
src/Test/Tasty/Sugar.hs view
@@ -385,13 +385,14 @@             let pVal = lookup name . expParamsMatch                 expSrt = L.sortBy (compare `on` pVal) exp                 expGrps = L.groupBy ((==) `on` pVal) expSrt-                f es =+                f es@(eh:_) =                   let gn = fromMaybe (name <> " not specified")                            $ (getParamVal =<<-                              (lookup name $ expParamsMatch $ head es)+                              (lookup name $ expParamsMatch eh)                              )                   in mkGroup gn <$> mkParams sweet es ps-            in sequence $ f <$> expGrps+                f [] = mkGroup (name <> " not specified") <$> mkParams sweet [] ps+            in sequence (f <$> expGrps)           Just vs -> let f v = mkGroup (name <> "=" <> v)                                <$> mkParams sweet (subExp v) ps                          subExp v = expMatching name v exp
src/internal/Test/Tasty/Sugar/Candidates.hs view
@@ -105,13 +105,17 @@                            $ DL.findIndices (`elem` (separators cube)) fName                       let vs = i + 1                       let ve = vs + vl+                      let chkStart = do guard $ v `elem` subPath+                                        return ((fst p, Explicit v), (0, 0))                       if and [ ve + 1 < fl  -- v fits in fName[i..]                              , v == DL.take vl (DL.drop vs fName)-                             , head (DL.drop ve fName) `elem` (separators cube)                              ]-                         then return ((fst p, Explicit v), (toEnum vs, ve))-                        else do guard $ v `elem` subPath-                                return ((fst p, Explicit v), (0, 0))+                         then case DL.drop ve fName of+                                (fnc:_) -> if fnc `elem` (separators cube)+                                           then return ((fst p, Explicit v), (toEnum vs, ve))+                                           else chkStart+                                [] -> chkStart+                         else chkStart       -- pmatchArbitrary will find a parameter with an unspecified value and       -- assigned otherwise unmatched portions of the filename to that parameter.       pmatchArbitrary =@@ -142,9 +146,11 @@       pAll = pmatches <> pmatchArbitrary       dropSeps i =         let lst = last $ DL.group $ DL.take (fromEnum i) fName-        in if isSep $ head lst-           then i - (toEnum (length lst) - 1)-           else i+        in case lst of+             (lh:_) -> if isSep lh+                       then i - (toEnum (length lst) - 1)+                       else i+             _ -> i       mtchIdx = dropSeps                 $ minimum                 $ toEnum fle@@ -217,7 +223,9 @@                      -> CandidateFile -> Bool candidateMatchSuffix seps sfx rootf cf =   let f = candidateFile cf-      sfxsep = not (null sfx) && head sfx `elem` seps+      sfxsep = case sfx of+                 (sfxHead:_) -> sfxHead `elem` seps+                 _ -> False   in if null sfx      then f == DL.takeWhile (not . (`elem` seps)) f      else and [ length f >= (length (candidateFile rootf) + length sfx)
src/internal/Test/Tasty/Sugar/ExpectCheck.hs view
@@ -236,7 +236,7 @@                . L.sortBy (compare `on` (length . expectedFile))                -- Discard all but the best ParamMatch               . L.reverse-               . head+               . (concat . take 1) -- safe version of head                -- Group by equal ParamMatch (may be multiple files)                . L.groupBy ((==) `on` expParamsMatch)                -- Order this group by best ParamsMatch (Explicit) to worst
src/internal/Test/Tasty/Sugar/Ranged.hs view
@@ -218,7 +218,9 @@                                 -- don't match e and should therefore just be                                 -- passed through.  Note that due to adjustExp                                 -- this should usually be a null list.-                              yv = getVal $ head yes+                              yv = case yes of+                                     (yh:_) -> getVal yh+                                     [] -> error "yes nullity is checked before getting yv"                           in case () of                                _ | null yes -> e:bests                                _ | ev == yv -> e:bests
src/internal/Test/Tasty/Sugar/Report.hs view
@@ -48,11 +48,11 @@ sweetsTextTable :: [CUBE] -> [Sweets] -> Text sweetsTextTable [] _ = "No CUBE provided for report" sweetsTextTable _ [] = "No Sweets provided for report"-sweetsTextTable c s =+sweetsTextTable (c:_) s =   let cfg = defaultRenderConfig             { rowGroup = "base"                          : "rootFile"-                         : (fromString . fst <$> take 1 (validParams $ head c))+                         : (fromString . fst <$> take 1 (validParams c))             , rowRepeat = False             }   in render cfg $ sweetsKVITable s
tasty-sugar.cabal view
@@ -1,7 +1,7 @@ cabal-version:       2.0  name:                tasty-sugar-version:             2.2.3.1+version:             2.2.3.2 synopsis:            Tests defined by Search Using Golden Answer References description:   .@@ -177,7 +177,7 @@                , prettyprinter                , raw-strings-qq >= 1.1 && < 1.2                , tasty-               , tasty-hedgehog >= 1.4 && < 1.5+               , tasty-hedgehog >= 1.3 && < 1.5                , tasty-hunit >= 0.10 && < 0.11                , tasty-sugar                , text