From e2f44ec7a5d87626db24200ea35188413650afee Mon Sep 17 00:00:00 2001 From: Schneems Date: Tue, 21 Jan 2025 17:49:28 -0600 Subject: [PATCH] Some lines have a hanging space, some don't --- buildpacks/jvm/tests/integration/versions.rs | 22 +++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/buildpacks/jvm/tests/integration/versions.rs b/buildpacks/jvm/tests/integration/versions.rs index 3a3fa7b..69f9a37 100644 --- a/buildpacks/jvm/tests/integration/versions.rs +++ b/buildpacks/jvm/tests/integration/versions.rs @@ -16,21 +16,21 @@ fn openjdk_default() { ]), |context| { assert_contains!( - context.pack_stderr, - &formatdoc! {" + trim_end_of_lines(&context.pack_stderr), + &trim_end_of_lines(&formatdoc! {" ! WARNING: No OpenJDK version specified - ! + ! ! Your application does not explicitly specify an OpenJDK version. The latest ! long-term support (LTS) version will be installed. This currently is OpenJDK 21. - ! + ! ! This default version will change when a new LTS version is released. Your ! application might fail to build with the new version. We recommend explicitly ! setting the required OpenJDK version for your application. - ! + ! ! To set the OpenJDK version, add or edit the system.properties file in the root ! directory of your application to contain: - ! - ! java.runtime.version = 21"}); + ! + ! java.runtime.version = 21"})); assert_contains!( context.run_shell_command("java -version").stderr, @@ -40,6 +40,14 @@ fn openjdk_default() { ); } +fn trim_end_of_lines(input: &str) -> String { + input + .lines() + .map(|line| line.trim_end()) + .collect::>() + .join("\n") +} + #[test] #[ignore = "integration test"] fn openjdk_functions_default() {