Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
05cf9043
Commit
05cf9043
authored
Jul 11, 2015
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update stretchr/testify godep
Fix panic in tests using mock due to stretchr/testify#180
parent
36fa535c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
Godeps.json
Godeps/Godeps.json
+3
-3
assertions.go
...pace/src/github.com/stretchr/testify/assert/assertions.go
+6
-1
assertions_test.go
...src/github.com/stretchr/testify/assert/assertions_test.go
+22
-0
No files found.
Godeps/Godeps.json
View file @
05cf9043
...
...
@@ -496,15 +496,15 @@
},
{
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
"Rev"
:
"
7e4a149930b09fe4c2b134c50ce637457ba6e966
"
"Rev"
:
"
089c7181b8c728499929ff09b62d3fdd8df8adff
"
},
{
"ImportPath"
:
"github.com/stretchr/testify/mock"
,
"Rev"
:
"
7e4a149930b09fe4c2b134c50ce637457ba6e966
"
"Rev"
:
"
089c7181b8c728499929ff09b62d3fdd8df8adff
"
},
{
"ImportPath"
:
"github.com/stretchr/testify/require"
,
"Rev"
:
"
7e4a149930b09fe4c2b134c50ce637457ba6e966
"
"Rev"
:
"
089c7181b8c728499929ff09b62d3fdd8df8adff
"
},
{
"ImportPath"
:
"github.com/syndtr/gocapability/capability"
,
...
...
Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions.go
View file @
05cf9043
...
...
@@ -84,6 +84,11 @@ func CallerInfo() []string {
return
nil
}
// This is a huge edge case, but it will panic if this is the case, see #180
if
file
==
"<autogenerated>"
{
break
}
parts
:=
strings
.
Split
(
file
,
"/"
)
dir
:=
parts
[
len
(
parts
)
-
2
]
file
=
parts
[
len
(
parts
)
-
1
]
...
...
@@ -296,7 +301,7 @@ func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
}
if
!
success
{
Fail
(
t
,
"Expected not to be nil."
,
msgAndArgs
...
)
Fail
(
t
,
"Expected
value
not to be nil."
,
msgAndArgs
...
)
}
return
success
...
...
Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions_test.go
View file @
05cf9043
...
...
@@ -2,6 +2,7 @@ package assert
import
(
"errors"
"io"
"math"
"regexp"
"testing"
...
...
@@ -789,3 +790,24 @@ func TestRegexp(t *testing.T) {
True
(
t
,
NotRegexp
(
mockT
,
regexp
.
MustCompile
(
tc
.
rx
),
tc
.
str
))
}
}
func
testAutogeneratedFunction
()
{
defer
func
()
{
if
err
:=
recover
();
err
==
nil
{
panic
(
"did not panic"
)
}
CallerInfo
()
}()
t
:=
struct
{
io
.
Closer
}{}
var
c
io
.
Closer
c
=
t
c
.
Close
()
}
func
TestCallerInfoWithAutogeneratedFunctions
(
t
*
testing
.
T
)
{
NotPanics
(
t
,
func
()
{
testAutogeneratedFunction
()
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment