mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
caps for exported package functions
parent
9377fd6fc2
commit
189a376fa6
@ -14,10 +14,10 @@ Avoid the use of 'assert' libraries to help your tests. Go developers arriving
|
||||
from xUnit frameworks often want to write code like:
|
||||
|
||||
```go
|
||||
assert.isNotNil(t, "obj", obj)
|
||||
assert.stringEq(t, "obj.Type", obj.Type, "blogPost")
|
||||
assert.intEq(t, "obj.Comments", obj.Comments, 2)
|
||||
assert.stringNotEq(t, "obj.Body", obj.Body, "")
|
||||
assert.IsNotNil(t, "obj", obj)
|
||||
assert.StringEq(t, "obj.Type", obj.Type, "blogPost")
|
||||
assert.IntEq(t, "obj.Comments", obj.Comments, 2)
|
||||
assert.StringNotEq(t, "obj.Body", obj.Body, "")
|
||||
```
|
||||
|
||||
but this either stops the test early (if assert calls `t.Fatalf` or `panic`)
|
||||
|
Loading…
x
Reference in New Issue
Block a user