File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
scenario-webgl-texture/src Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,8 @@ import qualified Test.Ext.ElmPages.Check
2121import qualified Test.TypeHashes
2222import qualified Test.JsOutput
2323import qualified Test.WebGL
24- <<<<<<< HEAD
2524import qualified Test.Lamdera.Live
26- =======
2725import qualified Test.BackwardsCompat
28- >>>>>>> bdcb71f7 (Test Lamdera HTML injections don't happen on vanilla Elm projects)
2926
3027import qualified Test.Lamdera.Evergreen.TestMigrationHarness
3128import qualified Test.Lamdera.Evergreen.TestMigrationGenerator
Original file line number Diff line number Diff line change @@ -46,4 +46,14 @@ suite = tests
4646 actual <- catchOutput $ Lamdera.Compile. makeDev project [ " src/Frontend.elm" , " src/Backend.elm" , " src/Types.elm" ]
4747
4848 expectTextContains actual " Success! Compiled 3 modules."
49+
50+ , scope " compilation should fail with WebGL.Texture in backend contexts" $ do
51+ project <- io $ Lamdera.Relative. requireDir " test/scenario-webgl-texture"
52+
53+ _ <- io $ rmdir (project </> " elm-stuff" )
54+
55+ actual <- catchOutput $ Lamdera.Compile. makeDev project [ " src/TestBadWebGL.elm" ]
56+
57+ -- Should fail with kernel error for browser-only types
58+ expectTextContains actual " can only be used in the frontend"
4959 ]
Original file line number Diff line number Diff line change 1+ module TestBadWebGL exposing (..)
2+
3+ -- This should fail compilation because WebGL.Texture is in ToBackend
4+ import WebGL.Texture as Texture
5+
6+
7+ type ToBackend
8+ = SendTexture Texture . Texture -- This should cause an error
9+
10+
11+ type alias BackendModel =
12+ { texture : Maybe Texture . Texture -- This should also cause an error
13+ }
You can’t perform that action at this time.
0 commit comments