···11+#!/bin/sh
22+33+set -eu
44+55+g() {
66+ echo "Running: gleam $@"
77+ cargo run --quiet -- "$@"
88+}
99+1010+echo This should succeed regardless of target as it is a dependency module
1111+g run --module=hello_joe --target=erlang
1212+g run --module=hello_joe --target=javascript
1313+1414+echo This should succeed as Erlang is supported
1515+g build --target=erlang
1616+g run --target=erlang
1717+1818+echo This should fail as JavaScript is not supported
1919+if g build --target=javascript; then
2020+ echo "Expected build to fail"
2121+ exit 1
2222+fi
2323+if g run --target=javascript; then
2424+ echo "Expected run to fail"
2525+ exit 1
2626+fi
···11+#!/bin/sh
22+33+set -eu
44+55+g() {
66+ echo "Running: gleam $@"
77+ cargo run --quiet -- "$@"
88+}
99+1010+echo This should succeed regardless of target as it is a dependency module
1111+g run --module=hello_joe --target=erlang
1212+g run --module=hello_joe --target=javascript
1313+1414+echo This should succeed as JavaScript is supported
1515+g build --target=javascript
1616+g run --target=javascript
1717+1818+echo This should fail as Erlang is not supported
1919+if g build --target=erlang; then
2020+ echo "Expected build to fail"
2121+ exit 1
2222+fi
2323+if g run --target=erlang; then
2424+ echo "Expected run to fail"
2525+ exit 1
2626+fi
···11-# run_dependency_with_broken_root
22-33-This package has a module with broken code.
44-It is used to test that running `gleam run -m <module>` with a module belonging
55-to an external dependency - gleeunit in this case - still works.
···11-name = "run_dependency_with_broken_root"
22-version = "1.0.0"
33-44-# Fill out these fields if you intend to generate HTML documentation or publish
55-# your project to the Hex package manager.
66-#
77-# description = ""
88-# licences = ["Apache-2.0"]
99-# repository = { type = "github", user = "username", repo = "project" }
1010-# links = [{ title = "Website", href = "https://gleam.run" }]
1111-#
1212-# For a full reference of all the available options, you can have a look at
1313-# https://gleam.run/writing-gleam/gleam-toml/.
1414-1515-[dependencies]
1616-gleam_stdlib = "~> 0.34 or ~> 1.0"
1717-1818-[dev-dependencies]
1919-gleeunit = "~> 1.0"