parent
20504d4a8b
commit
cacb876a95
|
@ -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 ))
|
||||
)
|
||||
old.decoder
|
||||
Iddict.decoder old.decoder
|
||||
|> D.map
|
||||
(\out ->
|
||||
( Iddict.map (always Tuple.first) out
|
||||
, Iddict.values out
|
||||
|> List.concatMap Tuple.second
|
||||
)
|
||||
)
|
||||
, docs = DocsIddict old.docs
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue