Browse files

Fixed adjust-timestamp tests to work in the US

  • Loading branch information...
1 parent bbcf4e8 commit 996e4eb5aa85b374eac6fe9ebd438b265c90519f @dlowe-net committed Oct 16, 2011
Showing with 10 additions and 8 deletions.
  1. +6 −4 src/local-time.lisp
  2. +4 −4 test/simple.lisp
View
10 src/local-time.lisp
@@ -736,10 +736,12 @@ In other words:
(push `(%set-timestamp-part ,part ,value) functions))
((string= operation :offset)
(push `(%offset-timestamp-part ,part ,value) functions))
- ((or (string= operation :utc-offset)
- (string= operation :timezone))
- (push (second change) params)
- (push operation params))
+ ((string= operation :utc-offset)
+ (push part params)
+ (push :utc-offset params))
+ ((string= operation :timezone)
+ (push part params)
+ (push :timezone params))
(t (error "Unexpected operation ~S" operation)))))
:finally
(loop
View
8 test/simple.lisp
@@ -98,20 +98,20 @@
(deftest test/adjust-timestamp/bug1 ()
(let* ((timestamp (parse-timestring "2006-01-01T00:00:00Z"))
- (modified-timestamp (adjust-timestamp timestamp (offset :year 1))))
+ (modified-timestamp (adjust-timestamp timestamp (timezone +utc-zone+) (offset :year 1))))
(is (timestamp= (parse-timestring "2007-01-01T00:00:00Z") modified-timestamp))))
(deftest test/adjust-timestamp/bug2 ()
(let* ((timestamp (parse-timestring "2009-03-01T01:00:00.000000+00:00"))
- (modified-timestamp (adjust-timestamp timestamp (offset :month 1))))
+ (modified-timestamp (adjust-timestamp timestamp (timezone +utc-zone+) (offset :month 1))))
(is (timestamp= (parse-timestring "2009-04-01T01:00:00.000000+00:00") modified-timestamp))))
(deftest test/adjust-timestamp/bug3 ()
(let* ((timestamp (parse-timestring "2009-03-01T01:00:00.000000+00:00"))
- (modified-timestamp (adjust-timestamp timestamp (offset :day-of-week :monday))))
+ (modified-timestamp (adjust-timestamp timestamp (timezone +utc-zone+) (offset :day-of-week :monday))))
(is (timestamp= (parse-timestring "2009-02-23T01:00:00.000000+00:00") modified-timestamp)))
(let* ((timestamp (parse-timestring "2009-03-04T01:00:00.000000+00:00"))
- (modified-timestamp (adjust-timestamp timestamp (offset :day-of-week :monday))))
+ (modified-timestamp (adjust-timestamp timestamp (timezone +utc-zone+) (offset :day-of-week :monday))))
(is (timestamp= (parse-timestring "2009-03-02T01:00:00.000000+00:00") modified-timestamp))))
#+nil

0 comments on commit 996e4eb

Please sign in to comment.