X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/768b1ef340c27cdfc3bc5c15f8f4c31d15ada122..b6912d6d22b3c6fc635e602412bdb83884630a38:/spec/parse_spec.lua?ds=sidebyside diff --git a/spec/parse_spec.lua b/spec/parse_spec.lua index 71df5fb..89c9a26 100644 --- a/spec/parse_spec.lua +++ b/spec/parse_spec.lua @@ -2,7 +2,7 @@ describe ( "Time parsing library" , function ( ) local timetable = require "luatz.timetable" local parse = require "luatz.parse" - it ( "RFC 3339 Parsing" , function ( ) + it ( "#RFC3339 parsing" , function ( ) assert.same ( timetable.new(2013,10,22,14,17,02) , (parse.rfc_3339 "2013-10-22T14:17:02Z") ) -- Numeric offsets accepted @@ -10,5 +10,8 @@ describe ( "Time parsing library" , function ( ) -- Missing offsets parse assert.same ( timetable.new(2013,10,22,14,17,02) , (parse.rfc_3339 "2013-10-22T14:17:02") ) + + -- Invalid + assert.same(nil, (parse.rfc_3339 "an invalid timestamp")) end ) end )