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

Side by Side Diff: logdog/common/viewer/url_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 unified diff | Download patch
« no previous file with comments | « logdog/common/viewer/url.go ('k') | logdog/server/archivist/archivist.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package viewer 5 package viewer
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "testing" 9 "testing"
10 10
11 "github.com/luci/luci-go/common/config"
12 "github.com/luci/luci-go/logdog/common/types" 11 "github.com/luci/luci-go/logdog/common/types"
12 "github.com/luci/luci-go/luci_config/common/cfgtypes"
13 13
14 . "github.com/smartystreets/goconvey/convey" 14 . "github.com/smartystreets/goconvey/convey"
15 ) 15 )
16 16
17 func TestGetURL(t *testing.T) { 17 func TestGetURL(t *testing.T) {
18 t.Parallel() 18 t.Parallel()
19 19
20 Convey(`Testing viewer URL generation`, t, func() { 20 Convey(`Testing viewer URL generation`, t, func() {
21 for _, tc := range []struct { 21 for _, tc := range []struct {
22 host string 22 host string
23 » » » project config.ProjectName 23 » » » project cfgtypes.ProjectName
24 paths []types.StreamPath 24 paths []types.StreamPath
25 url string 25 url string
26 }{ 26 }{
27 {"example.appspot.com", "test", []types.StreamPath{"foo/ bar/+/baz"}, 27 {"example.appspot.com", "test", []types.StreamPath{"foo/ bar/+/baz"},
28 "https://example.appspot.com/v/?s=test%2Ffoo%2Fb ar%2F%2B%2Fbaz"}, 28 "https://example.appspot.com/v/?s=test%2Ffoo%2Fb ar%2F%2B%2Fbaz"},
29 {"example.appspot.com", "test", []types.StreamPath{"foo/ bar/+/baz", "qux/+/quux"}, 29 {"example.appspot.com", "test", []types.StreamPath{"foo/ bar/+/baz", "qux/+/quux"},
30 "https://example.appspot.com/v/?s=test%2Ffoo%2Fb ar%2F%2B%2Fbaz&s=test%2Fqux%2F%2B%2Fquux"}, 30 "https://example.appspot.com/v/?s=test%2Ffoo%2Fb ar%2F%2B%2Fbaz&s=test%2Fqux%2F%2B%2Fquux"},
31 {"example.appspot.com", "test", []types.StreamPath{"quer y/*/+/**"}, 31 {"example.appspot.com", "test", []types.StreamPath{"quer y/*/+/**"},
32 "https://example.appspot.com/v/?s=test%2Fquery%2 F%2A%2F%2B%2F%2A%2A"}, 32 "https://example.appspot.com/v/?s=test%2Fquery%2 F%2A%2F%2B%2F%2A%2A"},
33 } { 33 } {
34 Convey(fmt.Sprintf(`Can generate a URL for host %q, proj ect %q, paths %q: [%s]`, tc.host, tc.project, tc.paths, tc.url), func() { 34 Convey(fmt.Sprintf(`Can generate a URL for host %q, proj ect %q, paths %q: [%s]`, tc.host, tc.project, tc.paths, tc.url), func() {
35 So(GetURL(tc.host, tc.project, tc.paths...), Sho uldEqual, tc.url) 35 So(GetURL(tc.host, tc.project, tc.paths...), Sho uldEqual, tc.url)
36 }) 36 })
37 } 37 }
38 }) 38 })
39 } 39 }
OLDNEW
« no previous file with comments | « logdog/common/viewer/url.go ('k') | logdog/server/archivist/archivist.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698