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

Unified Diff: luci_config/common/cfgtypes/config_set_test.go

Issue 2626433004: Move "common/config" common types into cfgtypes. (Closed)
Patch Set: Created 3 years, 11 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 | « luci_config/common/cfgtypes/config_set.go ('k') | luci_config/common/cfgtypes/project_name.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: luci_config/common/cfgtypes/config_set_test.go
diff --git a/luci_config/common/cfgtypes/config_set_test.go b/luci_config/common/cfgtypes/config_set_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..de6e5944db9b0c2518ab3ff79ab1a41368152d0e
--- /dev/null
+++ b/luci_config/common/cfgtypes/config_set_test.go
@@ -0,0 +1,36 @@
+// Copyright 2016 The LUCI Authors. All rights reserved.
+// Use of this source code is governed under the Apache License, Version 2.0
+// that can be found in the LICENSE file.
+
+package cfgtypes
+
+import (
+ "testing"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+func TestConfigSet(t *testing.T) {
+ t.Parallel()
+
+ Convey(`Testing config set utility methods`, t, func() {
+ So(ServiceConfigSet("my-service"), ShouldEqual, "services/my-service")
+ So(ProjectConfigSet("my-project"), ShouldEqual, "projects/my-project")
+ So(RefConfigSet("my-project", "refs/heads/master"), ShouldEqual, "projects/my-project/refs/heads/master")
+
+ project, configSet, tail := ConfigSet("projects/foo").SplitProject()
+ So(project, ShouldEqual, "foo")
+ So(configSet, ShouldEqual, "projects/foo")
+ So(tail, ShouldEqual, "")
+
+ project, configSet, tail = ConfigSet("projects/foo/refs/heads/master").SplitProject()
+ So(project, ShouldEqual, "foo")
+ So(configSet, ShouldEqual, "projects/foo")
+ So(tail, ShouldEqual, "refs/heads/master")
+
+ project, configSet, tail = ConfigSet("not/a/project/config/set").SplitProject()
+ So(project, ShouldEqual, "")
+ So(configSet, ShouldEqual, "")
+ So(tail, ShouldEqual, "")
+ })
+}
« no previous file with comments | « luci_config/common/cfgtypes/config_set.go ('k') | luci_config/common/cfgtypes/project_name.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698