From 11c5897737cce2a6982ab431a9148dcd7c7962af Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Thu, 8 Dec 2022 09:47:13 -0800 Subject: [PATCH] Seperate test scripts into 3 different scripts. --- examples/end-to-end/script/src/Hello.elm | 51 ------------------- examples/end-to-end/script/src/RepeatLog.elm | 23 +++++++++ .../end-to-end/script/src/SequenceHttpLog.elm | 31 +++++++++++ .../end-to-end/script/src/SequenceLog.elm | 25 +++++++++ 4 files changed, 79 insertions(+), 51 deletions(-) delete mode 100644 examples/end-to-end/script/src/Hello.elm create mode 100644 examples/end-to-end/script/src/RepeatLog.elm create mode 100644 examples/end-to-end/script/src/SequenceHttpLog.elm create mode 100644 examples/end-to-end/script/src/SequenceLog.elm diff --git a/examples/end-to-end/script/src/Hello.elm b/examples/end-to-end/script/src/Hello.elm deleted file mode 100644 index 88936577..00000000 --- a/examples/end-to-end/script/src/Hello.elm +++ /dev/null @@ -1,51 +0,0 @@ -module Hello exposing (run) - -import DataSource -import DataSource.Http -import Json.Decode as Decode -import Pages.Script as Script exposing (Script) - - -run : Script -run = - --Script.withoutCliOptions - -- (Script.log "-> 1" - -- |> DataSource.andThen - -- (\_ -> - -- Script.log "-> 2" - -- |> DataSource.andThen - -- (\_ -> - -- -- let - -- -- _ = - -- -- Debug.log "___3___" () - -- -- in - -- Script.log "-> 3" - -- |> DataSource.andThen - -- (\_ -> - -- --DataSource.Http.get - -- -- "https://api.github.com/repos/dillonkearns/elm-pages" - -- -- (Decode.field "stargazers_count" Decode.int) - -- -- |> DataSource.andThen - -- -- (\stars -> - -- -- Script.log (String.fromInt stars) - -- -- ) - -- Script.log "-> 4" - -- ) - -- ) - -- ) - -- ) - Script.withoutCliOptions - (Script.log "-> 1" - |> DataSource.andThen - (\_ -> - Script.log "-> 1" - |> DataSource.andThen - (\_ -> - Script.log "-> 1" - |> DataSource.andThen - (\_ -> - Script.log "-> 1" - ) - ) - ) - ) diff --git a/examples/end-to-end/script/src/RepeatLog.elm b/examples/end-to-end/script/src/RepeatLog.elm new file mode 100644 index 00000000..7ff30c67 --- /dev/null +++ b/examples/end-to-end/script/src/RepeatLog.elm @@ -0,0 +1,23 @@ +module RepeatLog exposing (run) + +import DataSource +import Pages.Script as Script exposing (Script) + + +run : Script +run = + Script.withoutCliOptions + (Script.log "-> 1" + |> DataSource.andThen + (\_ -> + Script.log "-> 1" + |> DataSource.andThen + (\_ -> + Script.log "-> 1" + |> DataSource.andThen + (\_ -> + Script.log "-> 1" + ) + ) + ) + ) diff --git a/examples/end-to-end/script/src/SequenceHttpLog.elm b/examples/end-to-end/script/src/SequenceHttpLog.elm new file mode 100644 index 00000000..6f77766e --- /dev/null +++ b/examples/end-to-end/script/src/SequenceHttpLog.elm @@ -0,0 +1,31 @@ +module SequenceHttpLog exposing (run) + +import DataSource +import DataSource.Http +import Json.Decode as Decode +import Pages.Script as Script exposing (Script) + + +run : Script +run = + Script.withoutCliOptions + (Script.log "-> 1" + |> DataSource.andThen + (\_ -> + Script.log "-> 2" + |> DataSource.andThen + (\_ -> + Script.log "-> 3" + |> DataSource.andThen + (\_ -> + DataSource.Http.get + "https://api.github.com/repos/dillonkearns/elm-pages" + (Decode.field "stargazers_count" Decode.int) + |> DataSource.andThen + (\stars -> + Script.log (String.fromInt stars) + ) + ) + ) + ) + ) diff --git a/examples/end-to-end/script/src/SequenceLog.elm b/examples/end-to-end/script/src/SequenceLog.elm new file mode 100644 index 00000000..7f564d5e --- /dev/null +++ b/examples/end-to-end/script/src/SequenceLog.elm @@ -0,0 +1,25 @@ +module SequenceLog exposing (run) + +import DataSource +import DataSource.Http +import Json.Decode as Decode +import Pages.Script as Script exposing (Script) + + +run : Script +run = + Script.withoutCliOptions + (Script.log "-> 1" + |> DataSource.andThen + (\_ -> + Script.log "-> 2" + |> DataSource.andThen + (\_ -> + Script.log "-> 3" + |> DataSource.andThen + (\_ -> + Script.log "-> 4" + ) + ) + ) + )