From 4737fd32db1a257f8ae984581824278498a93216 Mon Sep 17 00:00:00 2001 From: Stephan Schnabel Date: Wed, 12 Feb 2025 13:51:07 +0100 Subject: [PATCH] Remove ansi codes. --- src/it/level-from-micronaut/postbuild.bsh | 3 ++- src/it/log-text/postbuild.bsh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/it/level-from-micronaut/postbuild.bsh b/src/it/level-from-micronaut/postbuild.bsh index a280b60..026881f 100644 --- a/src/it/level-from-micronaut/postbuild.bsh +++ b/src/it/level-from-micronaut/postbuild.bsh @@ -7,12 +7,13 @@ for (String log : logs) { if (!log.contains("test-output-marker")) { continue; } - if (java.util.regex.Pattern.matches(expected, log)) { + if (java.util.regex.Pattern.matches(expected, log.replaceAll("\u001B\\[[;\\d]*m", ""))) { return true; } else { System.out.println("marker found, but formatting invalid:"); System.out.println("[EXPECTED] " + expected); System.out.println("[ACTUAL] " + log); + System.out.println("[BASE64] " + Base64.getEncoder().encodeToString(log.getBytes())); return false; } } diff --git a/src/it/log-text/postbuild.bsh b/src/it/log-text/postbuild.bsh index aa337ea..40e2f91 100644 --- a/src/it/log-text/postbuild.bsh +++ b/src/it/log-text/postbuild.bsh @@ -7,12 +7,13 @@ for (String log : logs) { if (!log.contains("test-output-marker")) { continue; } - if (java.util.regex.Pattern.matches(expected, log)) { + if (java.util.regex.Pattern.matches(expected, log.replaceAll("\u001B\\[[;\\d]*m", ""))) { return true; } else { System.out.println("marker found, but formatting invalid:"); System.out.println("[EXPECTED] " + expected); System.out.println("[ACTUAL] " + log); + System.out.println("[BASE64] " + Base64.getEncoder().encodeToString(log.getBytes())); return false; } }