提交 8db8f617 编写于 作者: K kfcampbell

Merge master to resolve merge conflict.

......@@ -3,7 +3,7 @@ package cmd
import (
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestNew(t *testing.T) {
......
......@@ -3,7 +3,7 @@ package commands
import (
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestNewArgs(t *testing.T) {
......
......@@ -6,7 +6,7 @@ import (
"regexp"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
"github.com/github/hub/ui"
)
......
package commands
import (
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
"testing"
)
......
package commands
import (
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
"testing"
)
......
......@@ -6,8 +6,8 @@ import (
"path/filepath"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/github"
"github.com/github/hub/internal/assert"
)
func setupInitContext() {
......
......@@ -16,6 +16,7 @@ type formatIssueTest struct {
}
func testFormatIssue(t *testing.T, tests []formatIssueTest) {
t.Helper()
for _, test := range tests {
if got := formatIssue(test.issue, test.format, test.colorize); got != test.expect {
t.Errorf("%s: formatIssue(..., %q, %t) = %q, want %q", test.name, test.format, test.colorize, got, test.expect)
......
......@@ -3,8 +3,8 @@ package commands
import (
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/github"
"github.com/github/hub/internal/assert"
)
func TestPullRequest_ParsePullRequestProject(t *testing.T) {
......
package commands
import (
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
"testing"
)
func testPush(t *testing.T) {
args := NewArgs([]string{"push", "origin,staging,qa", "bert_timeout"})
push(nil, args)
cmds := args.Commands()
assert.Equal(t, 3, len(cmds))
assert.Equal(t, "git push origin bert_timeout", cmds[0].String())
assert.Equal(t, "git push staging bert_timeout", cmds[1].String())
}
func TestTransformPushArgs(t *testing.T) {
args := NewArgs([]string{"push", "origin,staging,qa", "bert_timeout"})
transformPushArgs(args)
......
......@@ -5,9 +5,9 @@ import (
"regexp"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/fixtures"
"github.com/github/hub/github"
"github.com/github/hub/internal/assert"
)
func TestTransformRemoteArgs(t *testing.T) {
......
......@@ -3,7 +3,7 @@ package commands
import (
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestRunner_splitAliasCmd(t *testing.T) {
......
......@@ -5,7 +5,7 @@ import (
"os"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestDirIsNotEmpty(t *testing.T) {
......
......@@ -6,8 +6,8 @@ import (
"strings"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/fixtures"
"github.com/github/hub/internal/assert"
)
func TestGitDir(t *testing.T) {
......
......@@ -5,7 +5,7 @@ import (
"os"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestSSHConfigReader_Read(t *testing.T) {
......
......@@ -3,7 +3,7 @@ package git
import (
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func createURLParser() *URLParser {
......
......@@ -3,7 +3,7 @@ package github
import (
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestBranch_ShortName(t *testing.T) {
......
......@@ -6,7 +6,7 @@ import (
"regexp"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestClient_FormatError(t *testing.T) {
......
......@@ -6,8 +6,8 @@ import (
"strings"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/fixtures"
"github.com/github/hub/internal/assert"
)
func TestConfigService_TomlLoad(t *testing.T) {
......
......@@ -3,7 +3,7 @@ package github
import (
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestStackRemoveSelfAndPanic(t *testing.T) {
......
......@@ -6,7 +6,7 @@ import (
"os"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestEditor_openAndEdit_deleteFileWhenOpeningEditorFails(t *testing.T) {
......
......@@ -12,7 +12,7 @@ import (
"os"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func setupTestServer(unixSocket string) *testServer {
......
......@@ -4,7 +4,7 @@ import (
"net/url"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestGitHubRepo_remotesForPublish(t *testing.T) {
......
......@@ -3,7 +3,7 @@ package github
import (
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
)
func TestMessageBuilder_multiline_title(t *testing.T) {
......
......@@ -5,8 +5,8 @@ import (
"os"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/fixtures"
"github.com/github/hub/internal/assert"
)
func TestSameAs(t *testing.T) {
......
......@@ -3,8 +3,8 @@ package github
import (
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/fixtures"
"github.com/github/hub/internal/assert"
)
func TestGithubRemote_NoPush(t *testing.T) {
......
......@@ -5,8 +5,8 @@ import (
"path/filepath"
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/fixtures"
"github.com/github/hub/internal/assert"
)
var prContent = `Description
......
......@@ -3,8 +3,8 @@ package github
import (
"testing"
"github.com/bmizerany/assert"
"github.com/github/hub/fixtures"
"github.com/github/hub/internal/assert"
)
func TestParseURL(t *testing.T) {
......
......@@ -5,10 +5,8 @@ go 1.11
require (
github.com/BurntSushi/toml v0.3.0
github.com/atotto/clipboard v0.0.0-20171229224153-bc5958e1c833
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869
github.com/google/go-cmp v0.4.0
github.com/kballard/go-shellquote v0.0.0-20170619183022-cd60e84ee657
github.com/kr/pretty v0.0.0-20160823170715-cfb55aafdaf3 // indirect
github.com/kr/text v0.0.0-20160504234017-7cafcd837844 // indirect
github.com/mattn/go-colorable v0.0.9
github.com/mattn/go-isatty v0.0.3
github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747
......
......@@ -2,14 +2,10 @@ github.com/BurntSushi/toml v0.3.0 h1:e1/Ivsx3Z0FVTV0NSOv/aVgbUWyQuzj7DDnFblkRvsY
github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/atotto/clipboard v0.0.0-20171229224153-bc5958e1c833 h1:h/E5ryZTJAtOY6T3K6u/JA1OURt0nk1C4fITywxOp4E=
github.com/atotto/clipboard v0.0.0-20171229224153-bc5958e1c833/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/kballard/go-shellquote v0.0.0-20170619183022-cd60e84ee657 h1:vE7J1m7cCpiRVEIr1B5ccDxRpbPsWT5JU3if2Di5nE4=
github.com/kballard/go-shellquote v0.0.0-20170619183022-cd60e84ee657/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kr/pretty v0.0.0-20160823170715-cfb55aafdaf3 h1:dhwb1Ev84SKKVBfLuhR4bw/29yYHzwtTyTLUWWnvYxI=
github.com/kr/pretty v0.0.0-20160823170715-cfb55aafdaf3/go.mod h1:Bvhd+E3laJ0AVkG0c9rmtZcnhV0HQ3+c3YxxqTvc/gA=
github.com/kr/text v0.0.0-20160504234017-7cafcd837844 h1:kpzneEBeC0dMewP3gr/fADv1OlblH9r1goWVwpOt3TU=
github.com/kr/text v0.0.0-20160504234017-7cafcd837844/go.mod h1:sjUstKUATFIcff4qlB53Kml0wQPtJVc/3fWrmuUmcfA=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
......@@ -29,6 +25,8 @@ golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2 h1:T5DasATyLQfmbTpfEXx/IOL9v
golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.0.0-20190319135612-7b8349ac747c h1:nsJYChHWxeFA6+48RmvBXEvQNanNyh933kZYWiu2HBE=
......
// Package assert provides functions for testing.
package assert
import (
"fmt"
"reflect"
"testing"
"github.com/google/go-cmp/cmp"
)
// Equal makes the test as failed using default formatting if got is not equal to want.
func Equal(t testing.TB, want, got interface{}, args ...interface{}) {
t.Helper()
if !reflect.DeepEqual(want, got) {
msg := fmt.Sprint(args...)
t.Errorf("%s\n%s", msg, cmp.Diff(want, got))
}
}
// NotEqual makes the test as failed using default formatting if got is equal to want.
func NotEqual(t testing.TB, want, got interface{}, args ...interface{}) {
t.Helper()
if reflect.DeepEqual(want, got) {
msg := fmt.Sprint(args...)
t.Errorf("%s\nUnexpected: <%#v>", msg, want)
}
}
// T makes the test as failed using default formatting if ok is false.
func T(t testing.TB, ok bool, args ...interface{}) {
t.Helper()
if !ok {
msg := fmt.Sprint(args...)
t.Errorf("%s\nFailure", msg)
}
}
package utils
import (
"github.com/bmizerany/assert"
"github.com/github/hub/internal/assert"
"testing"
"time"
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册