From d1c7dc0a0a771978cb4ae8e13d16f791f0769914 Mon Sep 17 00:00:00 2001 From: Evan Benn Date: Fri, 18 Nov 2022 11:06:42 +1100 Subject: flashrom_tester: Fix unit test error Commit 065366d (flashrom_tester: Change timestamp to UTC microsecond) changed the time format, breaking the unit test. This patch fixes the unit test. BUG=None BRANCH=None TEST=cargo test Change-Id: Iba42a9026b41ddb61bb704aa1c26783cd251d787 Signed-off-by: Evan Benn Reviewed-on: https://review.coreboot.org/c/flashrom/+/69765 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Peter Marheine Reviewed-by: Edward O'Callaghan --- util/flashrom_tester/src/logger.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util/flashrom_tester/src') diff --git a/util/flashrom_tester/src/logger.rs b/util/flashrom_tester/src/logger.rs index fb26bde4..b700c19c 100644 --- a/util/flashrom_tester/src/logger.rs +++ b/util/flashrom_tester/src/logger.rs @@ -153,9 +153,10 @@ mod tests { assert_eq!(&buf[..5], "\x1b[35m"); // Time is difficult to test, assume it's formatted okay + // Split on the UTC timezone char assert_eq!( - &buf[24..], - " \x1b[33m[ INFO ]\x1b[0m Test message at INFO\n" + buf.split_once("Z ").unwrap().1, + "\x1b[33m[ INFO ]\x1b[0m Test message at INFO\n" ); } -- cgit v1.2.3