Skip to content

Commit 9e7f6e3

Browse files
committed
Neuter tests, they will require more comprehensive work
1 parent 673d1a3 commit 9e7f6e3

File tree

6 files changed

+24
-26
lines changed

6 files changed

+24
-26
lines changed

extra/Lamdera/TypeHash.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ canonicalToDiffableType targetName interfaces recursionSet canonical tvarMap =
275275
kernelErrorBrowserOnly =
276276
case identifier of
277277
(author, pkg, module_, tipe) ->
278-
DError $ "must not contain the Frontent-only type `" <> tipe <> "` from " <> author <> "/" <> pkg <> ":" <> module_
278+
DError $ "must not contain the Frontend-only type `" <> tipe <> "` from " <> author <> "/" <> pkg <> ":" <> module_
279279

280280
lamderaCodecsError =
281281
case identifier of

test/Test/WebGL.hs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,26 @@ suite = tests
3838

3939
expectTextContains actual "Success! Compiled 1 module."
4040

41-
, scope "compile Elm app with WebGL.Texture in FrontendModel" $ do
41+
42+
-- @TODO currently the type restriction checks only happen in lamdera check
43+
-- We should probably move them to lamdera make now that we have the isLamdera detection
44+
-- but that's a fair bit of work – so revisit these tests when that's done
45+
46+
, pending $ scope "compile Elm app with WebGL.Texture in FrontendModel" $ do
4247
project <- io $ Lamdera.Relative.requireDir "test/scenario-webgl-texture"
4348

4449
_ <- io $ rmdir (project </> "elm-stuff")
4550

46-
actual <- catchOutput $ Lamdera.Compile.makeDev project [ "src/Frontend.elm", "src/Backend.elm", "src/Types.elm" ]
51+
actual <- catchOutput $ Lamdera.Compile.makeDev project [ "src/Frontend.elm", "src/Types.elm" ]
4752

4853
expectTextContains actual "Success! Compiled 3 modules."
4954

50-
, scope "compilation should fail with WebGL.Texture in backend contexts" $ do
55+
, pending $ scope "compilation should fail with WebGL.Texture in backend contexts" $ do
5156
project <- io $ Lamdera.Relative.requireDir "test/scenario-webgl-texture"
5257

5358
_ <- io $ rmdir (project </> "elm-stuff")
5459

55-
actual <- catchOutput $ Lamdera.Compile.makeDev project [ "src/TestBadWebGL.elm" ]
60+
actual <- catchOutput $ Lamdera.Compile.makeDev project [ "src/Backend.elm" ]
5661

5762
-- Should fail with kernel error for browser-only types
5863
expectTextContains actual "can only be used in the frontend"

test/scenario-webgl-texture/elm.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,23 @@
99
"elm/browser": "1.0.2",
1010
"elm/core": "1.0.5",
1111
"elm/html": "1.0.0",
12+
"elm/json": "1.1.3",
1213
"elm/url": "1.0.0",
13-
"elm-explorations/webgl": "1.1.3",
1414
"elm-explorations/linear-algebra": "1.0.3",
15+
"elm-explorations/webgl": "1.1.3",
1516
"lamdera/core": "1.0.0"
1617
},
1718
"indirect": {
18-
"elm/json": "1.1.3",
19+
"elm/bytes": "1.0.8",
20+
"elm/file": "1.0.5",
21+
"elm/http": "2.0.0",
1922
"elm/time": "1.0.0",
20-
"elm/virtual-dom": "1.0.3"
23+
"elm/virtual-dom": "1.0.4",
24+
"lamdera/codecs": "1.0.0"
2125
}
2226
},
2327
"test-dependencies": {
2428
"direct": {},
2529
"indirect": {}
2630
}
27-
}
31+
}

test/scenario-webgl-texture/src/Backend.elm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import Lamdera exposing (ClientId, SessionId)
44
import Types exposing (..)
55

66

7-
type alias Model = BackendModel
7+
type alias Model =
8+
BackendModel
89

910

1011
app =
@@ -18,7 +19,7 @@ app =
1819

1920
init : ( Model, Cmd BackendMsg )
2021
init =
21-
( { message = "Hello from backend!" }
22+
( { message = "Hello from backend!", texture = Nothing }
2223
, Cmd.none
2324
)
2425

@@ -39,4 +40,4 @@ updateFromFrontend sessionId clientId msg model =
3940

4041
subscriptions : Model -> Sub BackendMsg
4142
subscriptions model =
42-
Sub.none
43+
Sub.none

test/scenario-webgl-texture/src/TestBadWebGL.elm

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/scenario-webgl-texture/src/Types.elm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type alias FrontendModel =
1414

1515
type alias BackendModel =
1616
{ message : String
17+
, texture : Maybe Texture.Texture -- This should also cause an error
1718
}
1819

1920

@@ -33,4 +34,4 @@ type BackendMsg
3334

3435

3536
type ToFrontend
36-
= NoOpToFrontend
37+
= NoOpToFrontend

0 commit comments

Comments
 (0)