Ivo van der Wijk
ac1463f956
Implement NotEqualValues
2020-05-27 08:39:56 +10:00
Matt Gorzka
e72b029e2a
new regex
2020-05-14 20:01:26 +10:00
zjx158094
d4e7ca1687
address comments
2020-05-14 19:53:33 +10:00
zjx158094
8329c5daa7
add test
2020-05-14 19:53:33 +10:00
zjx20
3ec00f620a
assertion_compare: fix format string for numbers
2020-05-14 19:53:33 +10:00
Pedro de Brito
15aff29f35
docs: update Comparison function comment
2020-05-06 18:14:40 +10:00
Bryan Boreham
f7ef284eb4
Add a benchmark to time trivial call of NotNil
2020-05-04 21:01:24 +10:00
Bryan Boreham
e734bda58c
Avoid calling Helper() on the happy path.
...
Helper() in the standard Go runtime fetches a stack trace from the
runtime, so is slow for calls that are made many times.
Helper() only makes a difference if the call throws an error, so move
it after the test in straightforward cases.
2020-05-04 21:01:24 +10:00
gohargasparyan
136026fb25
add test cases
2020-05-04 07:47:34 +10:00
gohargasparyan
1a43b8334a
add test cases
2020-05-04 07:47:34 +10:00
gohargasparyan
484fff1ace
didn't notice should run go generate
2020-05-04 07:47:34 +10:00
gohargasparyan
9d083cac4a
go format
2020-05-04 07:47:34 +10:00
gohargasparyan
0a813b5898
allow body for HTTPBodyContains and HTTPBodyNotContains for POST
2020-05-04 07:47:34 +10:00
David Wragg
ca8e08c131
Support uint in InDelta and InEpsilon
...
InDelta and InEpsilon assertions on uint values would fail with
the error "Parameters must be numerical".
2020-04-29 21:29:26 +10:00
Dave Henderson
d3decad621
Update dependency to gopkg.in/yaml.v3
...
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2020-04-28 07:45:39 +10:00
Martijn
bb468cc94d
Remove unneeded return statements
2020-04-06 07:42:56 +10:00
Martijn
28b7455875
Ran go generate ./...
2020-04-06 07:42:56 +10:00
Martijn
e0afeb10e3
Fix whitespace issues
2020-04-06 07:42:56 +10:00
Martijn
1454493cee
Add test for HTTPStatusCode
...
For purposes of the test, status code 101 is checked as this does not overlap with the other assertions. (HTTPSuccess, HTTPRedirect and HTTPError)
2020-04-06 07:42:56 +10:00
Martijn
f0828adbb3
Add HTTPStatusCode assertion
...
Allows for asserting a specific HTTP status code was returned instead of a general success, error or redirect assertion.
2020-04-06 07:42:56 +10:00
hectorj
012967472b
Make InEpsilon fail when given a NaN
...
fixes #918
2020-04-02 22:34:25 +11:00
Martin Sucha
f6cbfc0d03
Print more details in ElementsMatch
...
It is not very helpful to print that the lengths differ when an
assertion fails, since that does not reveal what the cause of the issue
might be.
Let's print which elements are extra in each list, that should convey
the relevant information to the user. Also use spew to format the
objects, similar to what Equal does, to make the output more readable.
2020-03-14 21:17:20 +11:00
Henry Blyth
cb23521296
Test verbose Contains Fail message
...
If asserting an error contained in a string, includeElement will fail
but Contains will confusingly print both values as strings, which can
look like a testify problem instead of an assertion failure.
2020-03-10 08:59:40 +11:00
Jordan Christiansen
c12dcedf28
Include the type in assert.Contains error messages
...
Fixes #828
2020-03-10 08:59:40 +11:00
alexpantyukhin
6be346c1f1
rename order files to compare files
2020-03-09 08:00:09 +11:00
Alexander Pantyukhin
9388656beb
fix language
2020-03-06 19:44:08 +11:00
Alexander Pantyukhin
2ca25e3fac
fix for assertions
2020-03-06 19:44:08 +11:00
Alexander Pantyukhin
ec73f449b3
add new tests
2020-03-06 19:44:08 +11:00
Alexander Pantyukhin
0b4ff03cda
update assertion_order.go according review notes
2020-03-06 19:44:08 +11:00
Alexander Pantyukhin
ad53dbbf0a
put constants instead of values.
2020-03-06 19:44:08 +11:00
alexpantyukhin
d583a38000
fix with gofmt tool
2020-03-06 19:44:08 +11:00
alexpantyukhin
f4b48264a4
fix fmt
2020-03-06 19:44:08 +11:00
alexpantyukhin
c106be4ce3
refactoring of assertion_order
2020-03-06 19:44:08 +11:00
Christian Muehlhaeuser
02b2656991
Handle ineffectual assignments
...
Removed ineffectual assignments.
2020-03-06 16:18:13 +11:00
Christian Muehlhaeuser
1c7f4ef084
Avoid unnecessary conversions
...
No need to convert values here.
2020-03-06 14:40:56 +11:00
Christian Muehlhaeuser
08b5acc756
Fixed tautological errors
...
err can't ever be not nil here, unless the Go language specs are changing.
2020-03-06 14:38:03 +11:00
Christian Muehlhaeuser
8bb674980e
Simplify code
...
- Direct boolean comparisons
- Don't use Sprintf when we can use the String() function
2020-03-06 14:36:53 +11:00
Christian Muehlhaeuser
fbbf8a0782
Removed unused variables
...
Probably just became obsolete by now.
2020-03-06 14:31:21 +11:00
Christian Muehlhaeuser
c5d499e514
Simplify go code
...
Just reads a bit nicer, in my opinion.
2020-03-06 14:30:34 +11:00
Hiram Chirino
310548cda6
fix: error diff was not being show for large values
...
If you were comparing values which when formatted were longer than about 64k then the actual, expected and diff messages were not printed to the console.
2020-03-04 06:47:27 +11:00
Luan Santos
afd4130c14
Disable using Stringer/error interfaces for diffing
...
`spew`'s default formatter will call `String()` or `Error()` in structs
that implement the `fmt.Stringer` or `error` interfaces. Depending on
the implementation of those, the diff can become quite useless to read
(see the example struct I used for the test case in this commit).
This changes `spew`'s configuration to `DisableMethods` so that it will
always use it's own pretty printer. This makes testing structs less
surprising and generally more useful, without tying the tests to the
implementation of `String()` (the user here can always chose to
`require.Equal(a.String(), b.String())` if testing those is important to
them.
2020-02-26 08:50:07 -07:00
Torkel Rogstad
17a1e1d4bf
Add Never assertion
...
Never asserts that a conditon isn't met within a given timeframe.
2020-01-29 09:11:59 +11:00
Duncan Mac-Vicar P
ce229281f0
assert.Eventually: fail the testcase if condition is not met
...
Fixes #837
2020-01-29 09:05:22 +11:00
Dinesh Kumar
8c465a0c8e
changing time.Duration equality mismatch output from int64 to readable format. Fixes #626
...
(cherry picked from commit 637cd144ddae7a3792bcb5c74a3bf3a071c0a250)
2020-01-16 14:34:20 +11:00
Boyan Soubachov
858f37ff9b
Allow nil-function Equal comparisons
2019-12-23 07:34:01 -07:00
Boyan Soubachov
22d5528225
Fix InDelta docstring
...
* Fixed the docstring for the InDelta function.
2019-12-23 07:31:11 -07:00
Boyan Soubachov
28b40b159e
Improve tests
2019-12-12 12:41:57 -07:00
Boyan Soubachov
4b71b28738
WIP
2019-12-12 12:41:57 -07:00
Boyan Soubachov
7b3a490010
Rename
2019-12-12 12:41:57 -07:00
Boyan Soubachov
937e12391f
Added negative dir and file tests
...
* Added NotFileExists test
* Added NotDirExists test
* Cleaned-up some comment formatting
2019-12-12 12:41:57 -07:00