Commit Graph

814 Commits (4c93d8f201cb46ed50de949ee65804f944b570f8)

Author SHA1 Message Date
Esdras Beleza de Noronha fdf3f01101 Update documentation 2020-03-11 19:42:32 +11:00
Esdras Beleza e8910bb335 Add stats to suites and tests 2020-03-11 19:42:32 +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 3acde138ca Format code with goimports
Fixed formatting and import order.
2020-03-06 14:39:08 +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
Boyan b7d60e3a8c Test go modules on and off for master builds 2020-02-28 06:47:40 -07: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
Ogoyukin 9f1c28b404 The mock.IsMethodCallable function is refactored 2020-02-26 16:09:38 +11:00
Ogoyukin 3a72ffb6d8 Refactored Test_Mock_IsMethodCallable 2020-02-26 16:09:38 +11:00
Ogoyukin 6bf5d94027 Update comment 2020-02-26 16:09:38 +11:00
Ogoyukin 4a3d527660 Refactored 'isArgsEqual' 2020-02-26 16:09:38 +11:00
Ogoyukin 36e077c09a Refactored 'IsMethodCallable' 2020-02-26 16:09:38 +11:00
Ogoyukin 42aafee8d7 Added function 'IsMethodCallable', which checking that the method can be called. 2020-02-26 16:09:38 +11:00
Boyan 3ebf1ddaeb Revert PR #867 2020-02-20 07:56:11 +11:00
Corey McGregor 624f997379 fix(suite): Add Fatalf method to suite.TestingT for gomock compatibility 2020-02-19 07:05:10 +11:00
Olaf Alders 5d2970ff94 Fix typo in CONTRIBUTING.md 2020-02-19 07:03:40 +11:00
Olaf Alders 2aadfe8adc Grammatical change in documentation for Run()
There was a switch between singular and plural which made this line a
little bit hard to parse.
2020-02-19 07:03:40 +11:00
Boyan Soubachov 55d8b5740c Add interface tests for suite.T 2020-02-06 07:41:25 +11:00
Chris K 9dfcf7c562 suite: make suite.TestingT satisfy mock.TestingT
...by adding Logf method.
2020-02-05 20:52:22 +11:00
Daniel Cormier 518a1491c7 IsType: A type-safe way of checking argument type
Like `assert.IsType(...)`, `mock.IsType` is used to check that the
type of an argument is the expected type. This is an alternative
to `AnythingOfType`.
2020-01-31 08:08:47 +11:00
Keynan Pratt ea72eb9159 added Log/Skip methods as required by CI tests 2020-01-29 11:08:28 +11:00
Keynan Pratt dca7be2281 updated TestingSuite interface to use TestingT 2020-01-29 11:08:28 +11:00
Keynan Pratt d3e61647c0 removed Helper method from TestingT interface 2020-01-29 11:08:28 +11:00
Keynan Pratt 045d838faf changed dependency to interface, s.t. consumers can easily mock the testing.T type 2020-01-29 11:08:28 +11: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
Boyan bda8848f6f Use latest Go master instead of dev
* Changed the latest Go version of the Travis build to be master instead of dev
2020-01-29 09:02:27 +11:00
Boyan Soubachov 9cc41e665b Check go generate on builds
* Check if we have mismatching `go generate ./...` output on builds
2020-01-29 07:21:51 +11:00
Boyan Soubachov 12fe0eb94c Remove redundant files
* Removed redundant `dep` files as we now use Go moduels
* Correct import order for package_test.go
2020-01-28 10:21:55 -07: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
devdinu 3c60a0e014 Merging suite_order_test in suite test, removing anonymous defer func call 2020-01-16 14:06:22 +11:00
Dinesh Kumar e7b6c14305 Remove parallel as that makes goroutines deadlock 2020-01-16 14:06:22 +11:00
Dinesh Kumar 0d3c8ce9f8 fixing suite teardown ordering issue
(cherry picked from commit 92c097a5af7b4bbbe3a66c2e7484f68194cd555a)
2020-01-16 14:06:22 +11:00
Boyan Soubachov 858f37ff9b Allow nil-function Equal comparisons 2019-12-23 07:34:01 -07:00