[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 04/08: time.test: Use 'pass-if-equal' in more tests.
From: |
Mark H. Weaver |
Subject: |
[Guile-commits] 04/08: time.test: Use 'pass-if-equal' in more tests. |
Date: |
Tue, 18 Jun 2019 02:08:20 -0400 (EDT) |
mhw pushed a commit to branch stable-2.2
in repository guile.
commit 75f3ba77596851724079670775e6c3ba3daf5929
Author: Mark H Weaver <address@hidden>
Date: Thu May 30 22:07:48 2019 -0400
time.test: Use 'pass-if-equal' in more tests.
* test-suite/tests/time.test ("strftime"): Change some uses of 'pass-if'
to instead use 'pass-if-equal'.
---
test-suite/tests/time.test | 36 ++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/test-suite/tests/time.test b/test-suite/tests/time.test
index da7a48c..2c829ab 100644
--- a/test-suite/tests/time.test
+++ b/test-suite/tests/time.test
@@ -195,37 +195,41 @@
(with-test-prefix "strftime"
- (pass-if "strftime %Z doesn't return garbage"
+ (pass-if-equal "strftime %Z doesn't return garbage"
+ "ZOW"
(let ((t (localtime (current-time))))
(set-tm:zone t "ZOW")
(set-tm:isdst t 0)
- (string=? (strftime "%Z" t)
- "ZOW")))
+ (strftime "%Z" t)))
- (pass-if "strftime passes wide characters"
+ (pass-if-equal "strftime passes wide characters"
+ "\u0100"
(let ((t (localtime (current-time))))
- (string=? (substring (strftime "\u0100%Z" t) 0 1)
- "\u0100")))
+ (substring (strftime "\u0100%Z" t) 0 1)))
(with-test-prefix "C99 %z format"
;; %z here is quite possibly affected by the same tm:gmtoff vs current
;; zone as %Z above is, so in the following tests we make them the same.
- (pass-if "GMT"
- (putenv "TZ=GMT+0")
- (tzset)
- (let ((tm (localtime 86400)))
- (string=? "+0000" (strftime "%z" tm))))
+ (pass-if-equal "GMT"
+ "+0000"
+ (begin
+ (putenv "TZ=GMT+0")
+ (tzset)
+ (let ((tm (localtime 86400)))
+ (strftime "%z" tm))))
;; prior to guile 1.6.9 and 1.8.1 this test failed, getting "+0500",
;; because we didn't adjust for tm:gmtoff being west of Greenwich versus
;; tm_gmtoff being east of Greenwich
- (pass-if "EST+5"
- (putenv "TZ=EST+5")
- (tzset)
- (let ((tm (localtime 86400)))
- (string=? "-0500" (strftime "%z" tm))))))
+ (pass-if-equal "EST+5"
+ "-0500"
+ (begin
+ (putenv "TZ=EST+5")
+ (tzset)
+ (let ((tm (localtime 86400)))
+ (strftime "%z" tm))))))
;;;
;;; strptime
- [Guile-commits] branch stable-2.2 updated (420c263 -> 8150823), Mark H. Weaver, 2019/06/18
- [Guile-commits] 01/08: Improve overflow checks in bytevector, string, and I/O operations., Mark H. Weaver, 2019/06/18
- [Guile-commits] 03/08: Fix typo in tags.h comment., Mark H. Weaver, 2019/06/18
- [Guile-commits] 05/08: scm_to_stringn: Avoid passing NULL to c_strcasecmp., Mark H. Weaver, 2019/06/18
- [Guile-commits] 02/08: Save and restore errno in the signal handler., Mark H. Weaver, 2019/06/18
- [Guile-commits] 04/08: time.test: Use 'pass-if-equal' in more tests.,
Mark H. Weaver <=
- [Guile-commits] 07/08: open-pipe*: Improve performance of OPEN_BOTH mode., Mark H. Weaver, 2019/06/18
- [Guile-commits] 06/08: Add get-bytevector-some!., Mark H. Weaver, 2019/06/18
- [Guile-commits] 08/08: Make 'get-bytevector-some' and 'get-bytevector-some!' suspendable., Mark H. Weaver, 2019/06/18