Fix test errors

elm-test --fuzz 1000 --seed 156536263253947
pull/34/head
Bram 2024-07-16 12:05:23 +02:00
parent 20504d4a8b
commit cacb876a95
2 changed files with 11 additions and 8 deletions

View File

@ -477,13 +477,14 @@ iddict (Coder old) =
Coder
{ encoder = Iddict.encode old.encoder
, decoder =
D.andThen
(\( out, logs ) ->
D.succeed out
|> Iddict.decoder
|> D.map (\o -> ( o, logs ))
Iddict.decoder old.decoder
|> D.map
(\out ->
( Iddict.map (always Tuple.first) out
, Iddict.values out
|> List.concatMap Tuple.second
)
)
old.decoder
, docs = DocsIddict old.docs
}

View File

@ -6,6 +6,7 @@ import Internal.Filter.Timeline as Filter
import Internal.Tools.Json as Json
import Internal.Values.Timeline as Timeline exposing (Batch, Timeline)
import Json.Decode as D
import Json.Encode as E
import Test exposing (..)
import Test.Filter.Timeline as TestFilter
@ -250,7 +251,8 @@ suite =
(\timeline ->
timeline
|> Json.encode Timeline.coder
|> D.decodeValue (Json.decode Timeline.coder)
|> E.encode 0
|> D.decodeString (Json.decode Timeline.coder)
|> Result.map Tuple.first
|> Result.map (Timeline.mostRecentEvents Filter.pass)
|> Expect.equal (Ok <| Timeline.mostRecentEvents Filter.pass timeline)