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

Unified Diff: logdog/common/types/streamname_test.go

Issue 2699943004: LogDog: Implement StreamName.Split. (Closed)
Patch Set: comments Created 3 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 | « logdog/common/types/streamname.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/common/types/streamname_test.go
diff --git a/logdog/common/types/streamname_test.go b/logdog/common/types/streamname_test.go
index 80650c56f8796e52455f39ab6bba170076ac93b6..897148661ba1fccd0e2ff2bb5e56c2cefa878974 100644
--- a/logdog/common/types/streamname_test.go
+++ b/logdog/common/types/streamname_test.go
@@ -162,6 +162,26 @@ func TestStreamName(t *testing.T) {
})
}
})
+
+ Convey(`StreamName.Split`, t, func() {
+ for _, tc := range []struct {
+ s StreamName
+ base StreamName
+ last StreamName
+ }{
+ {"", "", ""},
+ {"foo", "", "foo"},
+ {"/foo", "", "foo"},
+ {"foo/bar", "foo", "bar"},
+ {"foo/bar/baz", "foo/bar", "baz"},
+ } {
+ Convey(fmt.Sprintf(`Stream name %q splits into %q and %q.`, tc.s, tc.base, tc.last), func() {
+ base, last := tc.s.Split()
+ So(base, ShouldEqual, tc.base)
+ So(last, ShouldEqual, tc.last)
+ })
+ }
+ })
}
func TestStreamPath(t *testing.T) {
« no previous file with comments | « logdog/common/types/streamname.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698