Skip to content

Commit 89b2bad

Browse files
authored
Merge pull request #7 from vcaesar/test-pr
add assert IsType nil support and update CI
2 parents 7072b02 + 8674ccc commit 89b2bad

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ environment:
1212
matrix:
1313
- GOARCH: amd64
1414
# - GOARCH: 386
15-
GOVERSION: 1.14.7
15+
GOVERSION: 1.15.2
1616
# GOPATH: c:\gopath
1717

1818
install:

assert.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package tt
1616

1717
import (
18-
"reflect"
1918
"testing"
2019
)
2120

@@ -42,10 +41,8 @@ func (at *Assertions) BM(b *testing.B, fn func()) {
4241

4342
// IsType asserts that two objects type are equal
4443
func (at *Assertions) IsType(expect string, actual interface{}, args ...interface{}) bool {
45-
s := reflect.TypeOf(actual).String()
46-
47-
info, call, cinfo := typeCall(expect, s, args...)
48-
return Equal(at.t, expect, s, info, call, cinfo)
44+
info, call, cinfo := typeCall(expect, actual, args...)
45+
return IsType(at.t, expect, actual, info, call+1, cinfo)
4946
}
5047

5148
// Equal asserts that two objects are equal.

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 2
88
jobs:
99
build:
1010
docker:
11-
- image: golang:1.14.7
11+
- image: golang:1.15.2
1212
working_directory: /gopath/src/github.com/vcaesar/tt
1313
steps:
1414
- checkout

mock/mock.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package mock

tt_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ func TestArgs(t *testing.T) {
131131
at.True(1 == 1, "", 4)
132132
at.False(1 != 1, "", 4)
133133
at.IsType("int", 11, "", 4)
134+
at.IsType("nil", nil)
134135
}
135136

136137
func TestType(t *testing.T) {

0 commit comments

Comments
 (0)