[ARVADOS] updated: 2.1.0-652-gf297a0902
Git user
git at public.arvados.org
Fri Apr 16 14:48:14 UTC 2021
Summary of changes:
sdk/go/arvados/collection_test.go | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 sdk/go/arvados/collection_test.go
via f297a09022d0347dd565cf15725f8856835ed7f1 (commit)
from 954660e0bae16ea6d50ddc5793fef5e1431cba96 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit f297a09022d0347dd565cf15725f8856835ed7f1
Author: Tom Clegg <tom at curii.com>
Date: Fri Apr 16 10:48:01 2021 -0400
17346: Add test case.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/sdk/go/arvados/collection_test.go b/sdk/go/arvados/collection_test.go
new file mode 100644
index 000000000..b217b69a6
--- /dev/null
+++ b/sdk/go/arvados/collection_test.go
@@ -0,0 +1,35 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: Apache-2.0
+
+package arvados
+
+import (
+ check "gopkg.in/check.v1"
+)
+
+var _ = check.Suite(&CollectionSuite{})
+
+type CollectionSuite struct{}
+
+func (s *CollectionSuite) TestSizedDigests(c *check.C) {
+ coll := Collection{ManifestText: ". d41d8cd98f00b204e9800998ecf8427e+0 acbd18db4cc2f85cedef654fccc4a4d8+3 73feffa4b7f6bb68e44cf984c85f6e88+3+Z+K at xyzzy 0:0:foo 0:3:bar 3:3:baz\n"}
+ sd, err := coll.SizedDigests()
+ c.Check(err, check.IsNil)
+ c.Check(sd, check.DeepEquals, []SizedDigest{"acbd18db4cc2f85cedef654fccc4a4d8+3", "73feffa4b7f6bb68e44cf984c85f6e88+3"})
+
+ coll = Collection{ManifestText: ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:foo\n. acbd18db4cc2f85cedef654fccc4a4d8+3 0:3:bar\n. 73feffa4b7f6bb68e44cf984c85f6e88+3+Z+K at xyzzy 0:3:baz\n"}
+ sd, err = coll.SizedDigests()
+ c.Check(err, check.IsNil)
+ c.Check(sd, check.DeepEquals, []SizedDigest{"acbd18db4cc2f85cedef654fccc4a4d8+3", "73feffa4b7f6bb68e44cf984c85f6e88+3"})
+
+ coll = Collection{ManifestText: ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:foo\n"}
+ sd, err = coll.SizedDigests()
+ c.Check(err, check.IsNil)
+ c.Check(sd, check.HasLen, 0)
+
+ coll = Collection{ManifestText: "", PortableDataHash: "d41d8cd98f00b204e9800998ecf8427e+0"}
+ sd, err = coll.SizedDigests()
+ c.Check(err, check.IsNil)
+ c.Check(sd, check.HasLen, 0)
+}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list