mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-11-25 22:50:42 +03:00
add elm-animator runner
This commit is contained in:
parent
f271e041ac
commit
9609a945c4
18
testcases/elm-animator/Run.elm
Normal file
18
testcases/elm-animator/Run.elm
Normal file
@ -0,0 +1,18 @@
|
||||
port module Run exposing (main)
|
||||
|
||||
{-| -}
|
||||
|
||||
import Benchmark exposing (..)
|
||||
import Benchmark.Runner exposing (BenchmarkProgram, program)
|
||||
import Benchmark.Runner.Json
|
||||
import Benchmarks
|
||||
import Html
|
||||
import Json.Encode
|
||||
|
||||
|
||||
main : Benchmark.Runner.Json.JsonBenchmark
|
||||
main =
|
||||
Benchmark.Runner.Json.program reportResults Benchmarks.suite
|
||||
|
||||
|
||||
port reportResults : Json.Encode.Value -> Cmd msg
|
22
testcases/elm-animator/standard.html
Normal file
22
testcases/elm-animator/standard.html
Normal file
@ -0,0 +1,22 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Main</title>
|
||||
<script src="output/elm.opt.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="myapp"></div>
|
||||
<script>
|
||||
var app = Elm.Run.init({
|
||||
node: document.getElementById('myapp'),
|
||||
});
|
||||
|
||||
window.results = [];
|
||||
app.ports.reportResults.subscribe(function(message) {
|
||||
window.results = message;
|
||||
document.title = 'done';
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
21
testcases/elm-animator/transformed.html
Normal file
21
testcases/elm-animator/transformed.html
Normal file
@ -0,0 +1,21 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Main</title>
|
||||
<script src="output/elm.opt.transformed.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="myapp"></div>
|
||||
<script>
|
||||
var app = Elm.Run.init({
|
||||
node: document.getElementById('myapp'),
|
||||
});
|
||||
window.results = [];
|
||||
app.ports.reportResults.subscribe(function(message) {
|
||||
window.results = message;
|
||||
document.title = 'done';
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user