1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
12 func TestString(t *testing.T) {
13 d := Duration(123123123123 * time.Nanosecond)
14 if s, expect := d.String(), "123.123123"; s != expect {
15 t.Errorf("got %s, expect %s", s, expect)
19 func TestSet(t *testing.T) {
21 if err := d.Set("123.456"); err != nil {
24 if got, expect := time.Duration(d).Nanoseconds(), int64(123456000000); got != expect {
25 t.Errorf("got %d, expect %d", got, expect)