#! /usr/bin/env mzscheme
#lang scheme/base
(require (planet neil/testeez:1:2)
"rfc3339.ss")
(testeez
"rfc3339"
(test/equal ""
(rfc3339-string->list "1985-04-12T23:20:50.52Z")
'(1985 4 12 23 20 50 0.52 0))
(test/equal ""
(rfc3339-string->list "1985-04-12T23:20:50.52")
'(1985 4 12 23 20 50 0.52 #f))
(test/equal ""
(rfc3339-string->list "1985-04-12T23:20:50")
'(1985 4 12 23 20 50 #f #f))
(test/equal ""
(rfc3339-string->list "1985-04-12T23:20")
'(1985 4 12 23 20 #f #f #f))
(test/equal ""
(rfc3339-string->list "1985-04-12T23")
'(1985 4 12 23 #f #f #f #f))
(test/equal ""
(rfc3339-string->list "1985-04-12T")
'(1985 4 12 #f #f #f #f #f))
(test/equal ""
(rfc3339-string->list "1985-04-12")
'(1985 4 12 #f #f #f #f #f))
(test/equal ""
(rfc3339-string->list "1985-04")
'(1985 4 #f #f #f #f #f #f))
(test/equal ""
(rfc3339-string->list "1985")
'(1985 #f #f #f #f #f #f #f))
(test/equal
""
(rfc3339-record->string (string->rfc3339-record "1111-11-11T11:11:11.123"))
"1111-11-11T11:11:11.123")
(test/equal
""
(rfc3339-record->string (string->rfc3339-record "1111-11-11T11:11:11"))
"1111-11-11T11:11:11")
(test/equal
""
(rfc3339-record->string (string->rfc3339-record "1111-11-11T11:11:11.0"))
"1111-11-11T11:11:11.0")
(test/equal ""
(rfc3339-record->string (string->rfc3339-record "1-1-1"))
"0001-01-01")
(test/equal ""
(rfc3339-record->string (string->rfc3339-record "1:1:1"))
"01:01:01")
(test/equal
"" (rfc3339-record->string (string->rfc3339-record "T+0:0")) "Z")
(test/equal
"" (rfc3339-record->string (string->rfc3339-record "+0:0")) "Z")
(test/equal
"" (rfc3339-record->string (string->rfc3339-record "T-0:0")) "Z")
(test/equal
"" (rfc3339-record->string (string->rfc3339-record "-0:0")) "Z")
(test/equal
"" (rfc3339-record->string (string->rfc3339-record "TZ")) "Z")
(test/equal
"" (rfc3339-record->string (string->rfc3339-record "Z")) "Z")
(test/equal
"" (rfc3339-record->string (string->rfc3339-record "+0:01")) "+0:01")
(test/equal
"" (rfc3339-record->string (string->rfc3339-record "+000:01")) "+0:01")
(test/equal
"" (rfc3339-record->string (string->rfc3339-record "T12:34")) "12:34:00")
(test/equal
"" (rfc3339-record->string (string->rfc3339-record "12:34")) "12:34:00"))