From 40ef381fa262d94bcb32f1085aba1dce97c539fc Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Sun, 1 Feb 2026 22:25:10 -0500 Subject: [PATCH] [2.x] ExtendedRunnerTest (#8674) Problem/Solution Looks like this needs to be reformatted. --- .../src/test/scala/ExtendedRunnerTest.scala | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/launcher-package/integration-test/src/test/scala/ExtendedRunnerTest.scala b/launcher-package/integration-test/src/test/scala/ExtendedRunnerTest.scala index 69e312126..14dec7316 100755 --- a/launcher-package/integration-test/src/test/scala/ExtendedRunnerTest.scala +++ b/launcher-package/integration-test/src/test/scala/ExtendedRunnerTest.scala @@ -192,26 +192,26 @@ object ExtendedRunnerTest extends BasicTestSuite: IO.withTemporaryDirectory { baseDir => // Create a temporary directory with parentheses in the name val testDir = new File(baseDir, "test(parentheses)") - + // Create the directory structure IO.createDirectory(testDir) val projectDir = new File(testDir, "project") IO.createDirectory(projectDir) - + // Create a minimal build.properties to make it a valid sbt project val buildProps = new File(projectDir, "build.properties") IO.write(buildProps, "sbt.version=1.12.1\n") - + // Test 1: Run sbt from directory with parentheses - should work without parsing errors val out1 = sbtProcessInDir(testDir)("--script-version").!!.trim val expectedVersion = "^" + versionRegEx + "$" assert(out1.matches(expectedVersion), s"Expected version format, got: $out1") - + // Test 2: Test error message when no build.sbt exists (this is where the fix is most visible) // Create a directory with parentheses but no build.sbt val emptyDir = new File(baseDir, "empty(parentheses)") IO.createDirectory(emptyDir) - + // Run sbt from empty directory - should fail gracefully with proper error message // Use ProcessLogger to capture stderr without throwing on non-zero exit import scala.sys.process.ProcessLogger @@ -222,11 +222,14 @@ object ExtendedRunnerTest extends BasicTestSuite: ) val exitCode = sbtProcessInDir(emptyDir)("compile").!(logger) assert(exitCode == 1, "Expected sbt to fail when no build.sbt exists") - + // Verify the error output doesn't contain ") was unexpected" parsing error val errorOutput = errorBuffer.toString val hasParsingError = errorOutput.contains(") was unexpected") - assert(!hasParsingError, s"Error message should not contain parsing error when path has parentheses. Error output: $errorOutput") + assert( + !hasParsingError, + s"Error message should not contain parsing error when path has parentheses. Error output: $errorOutput" + ) } } ()