Use Go 1.9 t.Helper() to remove testify from the output of the tests and
stop using `\r` to try to overwrite the output.
This means in Go 1.7 and Go 1.8 testify will appear as failing the test.
HTTP assertions were missing the trailing `msgAndArgs ...interface{}`,
making it inconsistent with the rest of the assertions and resulting in
incorrect `*f` wrappers.
Fixes#528
commit 5b0291d47dc3a70cc6c6be3bba3c2f934a8e933e
Merge: 1f324ec 8ccf48a
Author: Dinesh Kumar <dineshkumar-cse@users.noreply.github.com>
Date: Sat Dec 30 19:55:13 2017 +0530
Merge branch 'master' into master
commit 1f324ec8cbe892a2c5364904643aa1b710121824
Author: Dinesh Kumar <dinesh.kumar@go-jek.com>
Date: Sat Dec 30 19:07:16 2017 +0530
Fixing comments: reduced test time, locking in after, unexported waitTime
- WaitUntil/After overrides each other value
- currently if channel is set that takes the priority, if not the
waitTime is used to Sleep
commit a7101ec14224918fc06532acae76418d1b4f04c5
Author: Dinesh Kumar <dinesh.kumar@go-jek.com>
Date: Fri Dec 29 13:02:14 2017 +0530
Using if else instead of switch and pulling out the commone one
commit 936f63dd689acacfd051867c5c700489caa1dbc2
Author: Dinesh Kumar <dinesh.kumar@go-jek.com>
Date: Fri Dec 29 12:41:40 2017 +0530
After - making it wait during method call
After was using call.WaitUntil(time.After(duration)),
<-time.After(duration) returns a channel with the timer immediately
started
An assertion that compares the elements of the slices/arrays disregarding the order,
i.e. it checks whether each element in the first slice/array appears the same number of times in it
as in the second slice/array.
This name seemed like it would be easy to find.
Possible alternatives for the name:
- ContainsSameElements
- IsPermutation (C++: http://en.cppreference.com/w/cpp/algorithm/is_permutation)
- MatchArray (rspec: http://www.rubydoc.info/github/rspec/rspec-expectations/RSpec/Matchers:match_array)
- EqualSorted
- Other ideas?
This implementaiton is O(N^2), while sorting both lists first would be O(nlogn).
However, this one doesn't need to copy the lists, so it is simpler and doesn't require additional
memory and time for the copies.
I realize this was deemed as out of scope
https://github.com/stretchr/testify/issues/275
but I decided to give it a shot as I needed it also.
The assertion function was simply returning false, which doesn't actually fail a test.
An example test that should have failed but doesn't:
func TestNotSubset(t *testing.T) {
assert.NotSubset(t, []string{"x"}, nil)
}
Make `Empty` work against any struct and custom types, by replacing
explicit zero value comparisons with a `DeepEqual` comparison with
the type's `reflect.ZeroValue`.
This change fixes a race condition I discovered when a multithreaded
test in a service I work on failed under -race. The included test case
simulates that failure (concurrent mutation of a Call with invocations
on the mock). The test will fail with a data race if run under the
race detector; the new locking ensures that call fields are not
accessed without the protection of the parent mutex.