From 56d49beaf6b82be9772259b73601c5610be53b6c Mon Sep 17 00:00:00 2001 From: sebres Date: Tue, 29 Oct 2024 21:52:42 +0100 Subject: [PATCH] clock-59.2: fix test for earlier tcl-version (free-scan handles only offset-TZ like +0200 correctly, and it'd be released with 8.6.16+) --- tests/clock.test | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/clock.test b/tests/clock.test index 575f7f8..193836f 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -38213,10 +38213,13 @@ test clock-59.2 {correct time zone names, format and scan back, bug and regressi } { set v [clock format $base -timezone Etc/GMT-2 -format "%Y-%m-%d %H:%M:%S %Z"] lappend result [expr {[set t [clock scan $v -format "%Y-%m-%d %H:%M:%S %Z"]] == $base ? 1 : "0 ($t != $base for $v)"}] - lappend result [expr {[set t [clock scan $v]] == $base ? 1 : "0 ($t != $base for $v)"}] + # free-scan only for 8.6.16+ (tzdata called +0200 instead of +02 for Etc/GMT-2) to avoid confusion: + if {[package vsatisfies [package provide Tcl] 8.6.16]} { + lappend result [expr {[set t [clock scan $v]] == $base ? 1 : "0 ($t != $base for $v)"}] + } } set result -} [lrepeat 12 1] +} [if {[package vsatisfies [package provide Tcl] 8.6.16]} {lrepeat 12 1} else {lrepeat 6 1}] # case-insensitive matching of weekday and month names [Bug 1781282]