Add back tests for List/indexed
(#405)
This adds back the missing tests for `List/indexed` (and fixes the test failures)
This commit is contained in:
parent
8a7f221c18
commit
508327d56f
|
@ -1438,8 +1438,7 @@ normalizeWith ctx e0 = loop (denote e0)
|
|||
m = case Data.Sequence.viewr ys of
|
||||
_ :> y -> Just y
|
||||
_ -> Nothing
|
||||
App (App ListIndexed _A₀) (ListLit _A₁ as₀) ->
|
||||
loop (ListLit (Just _A₂) as₁)
|
||||
App (App ListIndexed _A₀) (ListLit _A₁ as₀) -> loop (ListLit t as₁)
|
||||
where
|
||||
as₁ = Data.Sequence.mapWithIndex adapt as₀
|
||||
|
||||
|
@ -1449,6 +1448,9 @@ normalizeWith ctx e0 = loop (denote e0)
|
|||
, ("value", _A₀)
|
||||
]
|
||||
|
||||
t | null as₀ = Just _A₂
|
||||
| otherwise = Nothing
|
||||
|
||||
adapt n a_ =
|
||||
RecordLit (Data.HashMap.Strict.InsOrd.fromList kvs)
|
||||
where
|
||||
|
|
|
@ -87,6 +87,8 @@ preludeExamples =
|
|||
, shouldNormalize "List/generate" "./examples/List/generate/1"
|
||||
, shouldNormalize "List/head" "./examples/List/head/0"
|
||||
, shouldNormalize "List/head" "./examples/List/head/1"
|
||||
, shouldNormalize "List/indexed" "./examples/List/indexed/0"
|
||||
, shouldNormalize "List/indexed" "./examples/List/indexed/1"
|
||||
, shouldNormalize "List/iterate" "./examples/List/iterate/0"
|
||||
, shouldNormalize "List/iterate" "./examples/List/iterate/1"
|
||||
, shouldNormalize "List/last" "./examples/List/last/0"
|
||||
|
|
|
@ -1 +1 @@
|
|||
../../../../../Prelude/List/indexed Bool ([] : List Bool)
|
||||
../../../../../Prelude/List/indexed Bool [ True, False, True ]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[ { index = +0, value = True }
|
||||
, { index = +1, value = False }
|
||||
, { index = +2, valu;e = True }
|
||||
[ { index = 0, value = True }
|
||||
, { index = 1, value = False }
|
||||
, { index = 2, value = True }
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user