Skip to content

Commit

Permalink
Boost mt/string->date test.
Browse files Browse the repository at this point in the history
  • Loading branch information
katox committed Oct 14, 2020
1 parent 6a1c894 commit 1044dc5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/malli/transform_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,21 @@

(deftest string->date
(is (= #inst "2018-04-27T18:25:37Z" (mt/-string->date "2018-04-27T18:25:37Z")))
(is (= #inst "2018-04-27T18:25:37.100Z" (mt/-string->date "2018-04-27T18:25:37.1Z")))
(is (= #inst "2018-04-27T18:25:37.123Z" (mt/-string->date "2018-04-27T18:25:37.123Z")))
(is (= #inst "2018-04-27T18:25:37.123Z" (mt/-string->date "2018-04-27T18:25:37.123456Z")))
(is (= #inst "2018-04-27T18:25:37.123456Z" (mt/-string->date "2018-04-27T18:25:37.123456Z")))
(is (= #inst "2018-04-27T00:00:00Z" (mt/-string->date "2018-04-27")))
(is (= #inst "2018-04-27T05:00:00Z" (mt/-string->date "2018-04-27T08:00:00+03:00")))
(is (= #inst "2018-04-27T18:25:37Z" (mt/-string->date "2018-04-27T18:25:37.000Z")))
(is (= #inst "2018-04-27T18:25:37Z" (mt/-string->date "2018-04-27T18:25:37.000+0000")))
(is (= #inst "2018-04-27T18:25:37.100Z" (mt/-string->date "2018-04-27T18:25:37.1+0000")))
(is (= #inst "2018-04-27T18:25:37.123Z" (mt/-string->date "2018-04-27T18:25:37.123+0000")))
(is (= #inst "2018-04-27T18:25:37.123Z" (mt/-string->date "2018-04-27T18:25:37.123456+0000")))
(is (= #inst "2018-04-27T18:25:37.123456Z" (mt/-string->date "2018-04-27T18:25:37.123456+0000")))
(is (= #inst "2018-04-27T18:25:37.123Z" (mt/-string->date "2018-04-27T18:25:37.123+0000")))
(is (= #inst "2018-04-27T18:25:37.123Z" (mt/-string->date "2018-04-27T20:25:37.123+0200")))
(is (= #inst "2018-04-27T18:25:37.123Z" (mt/-string->date "2018-04-27T16:25:37.123-0200")))
(is (= #inst "2014-02-18T18:25:37Z" (mt/-string->date #inst "2014-02-18T18:25:37Z")))
(is (= #inst "2018-04-27T00:00:00Z" (mt/-string->date #inst "2018-04-27")))
(is (= #inst "2018-04-27T05:00:00Z" (mt/-string->date #inst "2018-04-27T08:00:00+03:00")))
Expand Down

0 comments on commit 1044dc5

Please sign in to comment.