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 Coder
{ encoder = Iddict.encode old.encoder { encoder = Iddict.encode old.encoder
, decoder = , decoder =
D.andThen Iddict.decoder old.decoder
(\( out, logs ) -> |> D.map
D.succeed out (\out ->
|> Iddict.decoder ( Iddict.map (always Tuple.first) out
|> D.map (\o -> ( o, logs )) , Iddict.values out
) |> List.concatMap Tuple.second
old.decoder )
)
, docs = DocsIddict old.docs , docs = DocsIddict old.docs
} }

View File

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