diff --git a/testcases/elm-ui/Main.elm b/testcases/elm-ui/Main.elm new file mode 100644 index 0000000..256ea3b --- /dev/null +++ b/testcases/elm-ui/Main.elm @@ -0,0 +1,51 @@ +port module Main exposing (main) + +{-| -} + +import Benchmark exposing (..) +import Benchmark.Runner exposing (BenchmarkProgram, program) +import Benchmark.Runner.Json +import Element exposing (..) +import Element.Background as Background +import Element.Font as Font +import Html +import Html.Attributes as Attr +import Json.Encode + + +main : Benchmark.Runner.Json.JsonBenchmark +main = + Benchmark.Runner.Json.program reportResults suite + + +port reportResults : Json.Encode.Value -> Cmd msg + + +three = + List.repeat 3 0 + + +suite : Benchmark +suite = + describe "Elm UI" + [ benchmark "create a 4 level nested Elm UI tree" <| + \_ -> + Element.layout [] + (Element.column [] (List.map (viewLevels 4) three)) + ] + + +blue = + rgb 0 0 1 + + +viewLevels level _ = + if level == 0 then + none + + else + Element.row + [ Font.size 16 + , Background.color blue + ] + (List.map (viewLevels (level - 1)) three) diff --git a/testcases/elm-ui/elm.json b/testcases/elm-ui/elm.json new file mode 100644 index 0000000..22b005c --- /dev/null +++ b/testcases/elm-ui/elm.json @@ -0,0 +1,31 @@ +{ + "type": "application", + "source-directories": [ + ".", + "../benchmark-utilities" + ], + "elm-version": "0.19.1", + "dependencies": { + "direct": { + "BrianHicks/elm-trend": "2.1.3", + "elm/browser": "1.0.2", + "elm/core": "1.0.5", + "elm/html": "1.0.0", + "elm/json": "1.1.3", + "elm-explorations/benchmark": "1.0.1", + "mdgriffith/elm-ui": "1.1.8" + }, + "indirect": { + "Skinney/murmur3": "2.0.8", + "elm/regex": "1.0.0", + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "elm/virtual-dom": "1.0.2", + "mdgriffith/style-elements": "5.0.1" + } + }, + "test-dependencies": { + "direct": {}, + "indirect": {} + } +} diff --git a/testcases/elm-ui/standard.html b/testcases/elm-ui/standard.html new file mode 100644 index 0000000..f076b31 --- /dev/null +++ b/testcases/elm-ui/standard.html @@ -0,0 +1,22 @@ + + + + Main + + + + +
+ + + diff --git a/testcases/elm-ui/transformed.html b/testcases/elm-ui/transformed.html new file mode 100644 index 0000000..5b8d016 --- /dev/null +++ b/testcases/elm-ui/transformed.html @@ -0,0 +1,21 @@ + + + + Main + + + + +
+ + +