From 486d83051070ec2f5e77a8f88a9a18e27e91f4c1 Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Thu, 20 Feb 2025 19:38:08 +0100 Subject: [PATCH] update to rust 1.85 to support 2024 edition cargo added some whitespace to the output, so there is a little more trimming to reduce the noice in the expected test output. --- Dockerfile | 6 +++--- bin/run-tests.sh | 2 +- src/output.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0c9d989..8555ba5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # always build this using the latest stable release -FROM rust:1.80.0 AS build-base +FROM rust:1.85.0 AS build-base ARG JQ_VERSION=1.6 ARG JQ_URL=https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64 @@ -48,7 +48,7 @@ RUN cargo generate-lockfile && cargo local-registry --sync Cargo.lock . # version tag with a nightly one, pinned to a specific date. # official Dockerfile source: -# https://github.com/rust-lang/docker-rust/blob/master/1.80.0/bookworm/slim/Dockerfile +# https://github.com/rust-lang/docker-rust/blob/master/stable/bookworm/slim/Dockerfile ################ start-copy-pasta ################ @@ -57,7 +57,7 @@ FROM debian:bookworm-slim ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=nightly-2024-08-02 + RUST_VERSION=nightly-2025-02-20 # ~~~~~~~~^~~~~~~~~~ # pin version here diff --git a/bin/run-tests.sh b/bin/run-tests.sh index 700e281..a476def 100755 --- a/bin/run-tests.sh +++ b/bin/run-tests.sh @@ -2,7 +2,7 @@ set -eo pipefail # Synopsis: -# Test the test runner by running it against a predefined set of solutions +# Test the test runner by running it against a predefined set of solutions # with an expected output. # Output: diff --git a/src/output.rs b/src/output.rs index 7f869ad..59d3a13 100644 --- a/src/output.rs +++ b/src/output.rs @@ -33,11 +33,11 @@ impl TestResult { pub fn fail(name: String, test_code: String, message: Option) -> TestResult { let name = format_test_name(name); - let (output, message) = match message.as_ref().and_then(|m| m.split_once("thread '")) { + let (output, message) = match message.as_ref().and_then(|m| m.split_once("\nthread '")) { Some((output, message)) if !output.is_empty() => { (Some(output.to_owned()), Some(format!("thread '{message}"))) } - _ => (None, message), + _ => (None, message.map(|m| m.trim_start().to_owned())), }; // This note is attached to the error message of only one test case that fails,