parent
20504d4a8b
commit
cacb876a95
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue