Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: common/clock/tags_test.go

Issue 1679023005: Add Context cancellation to clock. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Actually upload the patch. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/clock/tags.go ('k') | common/clock/testclock/testclock.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/clock/tags_test.go
diff --git a/common/clock/tags_test.go b/common/clock/tags_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..89ce227622a262c498a200805e70d99d98c97d6b
--- /dev/null
+++ b/common/clock/tags_test.go
@@ -0,0 +1,39 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package clock
+
+import (
+ "testing"
+
+ "golang.org/x/net/context"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+func TestTags(t *testing.T) {
+ Convey(`An empty Context`, t, func() {
+ c := context.Background()
+
+ Convey(`Should have nil tags.`, func() {
+ So(Tags(c), ShouldBeNil)
+ })
+
+ Convey(`With tag, "A"`, func() {
+ c = Tag(c, "A")
+
+ Convey(`Should have tags {"A"}.`, func() {
+ So(Tags(c), ShouldResemble, []string{"A"})
+ })
+
+ Convey(`And another tag, "B"`, func() {
+ c = Tag(c, "B")
+
+ Convey(`Should have tags {"A", "B"}.`, func() {
+ So(Tags(c), ShouldResemble, []string{"A", "B"})
+ })
+ })
+ })
+ })
+}
« no previous file with comments | « common/clock/tags.go ('k') | common/clock/testclock/testclock.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698