PlatformManagerCommandTest
Tags:elm-unspecced
A command of a manager of the platform is handed to the platform, which gives its message. A Standard Definition of Elm?, rules p-disp-plat and p-platform: a leaf command of a manager of the platform is dispatched to the platform, whose steps act on it. Which managers a platform has is a parameter of the platform (ruling A83); for Elm on JavaScript they include `Random`'s (Appendix C, Managers and Programs on a Platform). `Random.generate` with a constant generator gives the message `7` whatever the seed. <https://elm-test-suite.netlify.app/standard/rules/p-disp-plat> Tagged `elm-unspecced`: which managers a platform has, and what they give, is a parameter of the platform in A Standard Definition of Elm? (ruling A83). The test records what Elm 0.19.1 does.
Results
elm-0.19.1
passran in 64 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. generated: 7
elm-0.19.2
passran in 64 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. generated: 7
elm-0.19.3
passran in 63 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. generated: 7
lamdera-1.5.0
passran in 61 msOutput
generated: 7
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm/PlatformManagerCommandTest] in its title.
Source
The -- CHECK: lines give the expected output.
module PlatformManagerCommandTest exposing (main)
{-| A command of a manager of the platform is handed to the platform, which gives its message.
A Standard Definition of Elm?, rules p-disp-plat and p-platform: a leaf command of a manager of the
platform is dispatched to the platform, whose steps act on it. Which managers a platform has is a
parameter of the platform (ruling A83); for Elm on JavaScript they include `Random`'s
(Appendix C, Managers and Programs on a Platform). `Random.generate` with a constant generator
gives the message `7` whatever the seed. <https://elm-test-suite.netlify.app/standard/rules/p-disp-plat>
Tagged `elm-unspecced`: which managers a platform has, and what they give, is a parameter of the
platform in A Standard Definition of Elm? (ruling A83). The test records what Elm 0.19.1 does.
-}
-- TAGS: elm-unspecced
-- CHECK: generated: 7
import Random
type Msg
= Generated Int
main : Program () () Msg
main =
Platform.worker
{ init = \_ -> ( (), Random.generate Generated (Random.constant 7) )
, update =
\(Generated n) model ->
let
_ =
Debug.log "generated" n
in
( model, Cmd.none )
, subscriptions = \_ -> Sub.none
}