summaryrefslogtreecommitdiffstats
path: root/time/time_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'time/time_test.go')
-rw-r--r--time/time_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/time/time_test.go b/time/time_test.go
index efb3078..3f0bb84 100644
--- a/time/time_test.go
+++ b/time/time_test.go
@@ -69,6 +69,26 @@ func TestDurationToSeconds(t *testing.T) {
t.Errorf("duration in seconds incorrect: %v", d)
return
}
+
+ d, err = Duration("P3DT45M")
+ if err != nil {
+ t.Errorf("failed: %v", err)
+ return
+ }
+ if d.Seconds() != 261900 {
+ t.Errorf("duration in seconds incorrect: %v", d)
+ return
+ }
+
+ d, err = Duration("P7DT18H")
+ if err != nil {
+ t.Errorf("failed: %v", err)
+ return
+ }
+ if d.Seconds() != 669600 {
+ t.Errorf("duration in seconds incorrect: %v", d)
+ return
+ }
}
func TestIsCurrent(t *testing.T) {