From 20efc7877e51d65a65d9f81710c9022ef6e024a4 Mon Sep 17 00:00:00 2001 From: Robin Heggelund Hansen Date: Thu, 15 Jul 2021 22:24:29 +0200 Subject: [PATCH] Minor changes to update testcase. --- testcases/updates/Suite.elm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/testcases/updates/Suite.elm b/testcases/updates/Suite.elm index c2520c7..49a8051 100644 --- a/testcases/updates/Suite.elm +++ b/testcases/updates/Suite.elm @@ -2,10 +2,7 @@ module Suite exposing (suite) {-| -} -import Html -import Html.Attributes as Attr import V8.Benchmark.Runner.Json exposing (..) -import V8.Debug type alias Model = @@ -25,7 +22,7 @@ emptyRecord = type Msg = SetString String - | SetNum Int + | SetAll String Int update : Msg -> Model -> Model @@ -37,10 +34,11 @@ update msg model = , sortKey = ( val, model.someNum ) } - SetNum val -> + SetAll str int -> { model - | someNum = val - , sortKey = ( model.someString, val ) + | someString = str + , someNum = int + , sortKey = ( str, int ) } @@ -52,7 +50,7 @@ range = suite : Benchmark suite = describe "Updates" - [ benchmark "Inc" <| + [ benchmark "Update" <| \_ -> List.foldl updater emptyRecord range ] @@ -62,4 +60,4 @@ updater : Int -> Model -> Model updater idx rec = rec |> update (SetString ("String" ++ String.fromInt idx)) - |> update (SetNum idx) + |> update (SetAll ("Str-" ++ String.fromInt idx) idx)