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

Side by Side Diff: client/internal/lhttp/utils_test.go

Issue 1159563002: Move retry and lhttp packages from client/internal to common/. (Closed) Base URL: git@github.com:luci/luci-go@master
Patch Set: move-retry-http 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 unified diff | Download patch
« no previous file with comments | « client/internal/lhttp/utils.go ('k') | client/internal/retry/doc.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package lhttp
6
7 import (
8 "errors"
9 "testing"
10
11 "github.com/maruel/ut"
12 )
13
14 func TestURLToHTTPS(t *testing.T) {
15 data := []struct {
16 in string
17 expected string
18 err error
19 }{
20 {"foo", "https://foo", nil},
21 {"https://foo", "https://foo", nil},
22 {"http://foo", "", errors.New("Only https:// scheme is accepted. It can be omitted.")},
23 }
24 for i, line := range data {
25 out, err := URLToHTTPS(line.in)
26 ut.AssertEqualIndex(t, i, line.expected, out)
27 ut.AssertEqualIndex(t, i, line.err, err)
28 }
29 }
OLDNEW
« no previous file with comments | « client/internal/lhttp/utils.go ('k') | client/internal/retry/doc.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698