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

Unified Diff: go/src/infra/tools/cipd/common_test.go

Issue 1130733007: cipd: Add -tag option to 'create' and 'pkg-register' subcomands. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 7 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 | « go/src/infra/tools/cipd/common.go ('k') | go/src/infra/tools/cipd/remote.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/tools/cipd/common_test.go
diff --git a/go/src/infra/tools/cipd/common_test.go b/go/src/infra/tools/cipd/common_test.go
index 039b208ddf5a018f7049a6dd18b254726bad2a1e..c0bd2d8c2e627b6595c0795c72b4e6f74d554704 100644
--- a/go/src/infra/tools/cipd/common_test.go
+++ b/go/src/infra/tools/cipd/common_test.go
@@ -72,3 +72,16 @@ func TestValidateInstanceID(t *testing.T) {
So(ValidateInstanceID("AAAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), ShouldNotBeNil)
})
}
+
+func TestValidateInstanceTag(t *testing.T) {
+ Convey("ValidateInstanceTag works", t, func() {
+ So(ValidateInstanceTag(""), ShouldNotBeNil)
+ So(ValidateInstanceTag("notapair"), ShouldNotBeNil)
+ So(ValidateInstanceTag(strings.Repeat("long", 200)+":abc"), ShouldNotBeNil)
+ So(ValidateInstanceTag("BADKEY:value"), ShouldNotBeNil)
+ So(ValidateInstanceTag("good:tag"), ShouldBeNil)
+ So(ValidateInstanceTag("good_tag:"), ShouldBeNil)
+ So(ValidateInstanceTag("good:tag:blah"), ShouldBeNil)
+ So(ValidateInstanceTag("good_tag:asdad/asdad/adad/a\\asdasdad"), ShouldBeNil)
+ })
+}
« no previous file with comments | « go/src/infra/tools/cipd/common.go ('k') | go/src/infra/tools/cipd/remote.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698