From aa2898d323e66ac7327c1aa60bb9ae47aa2152d7 Mon Sep 17 00:00:00 2001 From: Adam Fisher Date: Tue, 4 Aug 2026 14:15:25 +0000 Subject: [PATCH] Make the scala example test pass and script/test CI-friendly whereWeLive returned "Mars" while MainTest expected "Earth". Both now use "Earth". script/test ran `sbt ~test`, which watches for changes and never exits. It now runs the tests once, with the watch loop behind --watch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- scala/script/test | 10 ++++++++-- scala/src/main/scala/gu/com/Main.scala | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scala/script/test b/scala/script/test index 162a8a0..330cdfd 100755 --- a/scala/script/test +++ b/scala/script/test @@ -1,5 +1,11 @@ #!/usr/bin/env bash -set -e +set -euo pipefail -sbt ~test +cd "$(dirname "${BASH_SOURCE[0]}")/.." + +if [[ "${1:-}" == "--watch" ]]; then + sbt "~test" +else + sbt test +fi diff --git a/scala/src/main/scala/gu/com/Main.scala b/scala/src/main/scala/gu/com/Main.scala index c9066df..7e6be93 100644 --- a/scala/src/main/scala/gu/com/Main.scala +++ b/scala/src/main/scala/gu/com/Main.scala @@ -5,5 +5,5 @@ object Main { } - def whereWeLive = "Mars" + def whereWeLive = "Earth" }