Commit Graph

74 Commits (fix-1231-InEpsilonSlice-expected-actual-order)

Author SHA1 Message Date
Olivier Mengué 486eb6f08c
Merge pull request #1406 from dolmen-go/use-std-header-for-generated-code
codegen: use standard header for generated files
2023-07-22 08:51:09 +02:00
Oleksandr Redko 37814a1755 docs: Fix typos in tests and comments 2023-07-06 13:14:39 +03:00
Olivier Mengué 5ca0755b51 codegen: use standard header for generated files
Use the standard header in generated Go sources.
See https://go.dev/s/generatedcode.
2023-07-02 21:06:15 +02:00
Harald Nordgren 4c93d8f201
EqualExportedValues: Handle nested pointer, slice and map fields (#1379)
* EqualExportedValues: Handle pointer and slice fields

* Update assert/assertions.go

Co-authored-by: Michael Pu <michael.pu123@gmail.com>

* Reduce redundant calls to 'copyExportedFields'

* Update comments

* Add support for maps

* Update Go version support to 1.19 and onward

* Re-generate after rebasing

---------

Co-authored-by: Michael Pu <michael.pu123@gmail.com>
2023-05-11 07:42:04 +10:00
Tobias Krischer 4b2f4d2bcf
add EventuallyWithT assertion (#1264)
* add EventuallyWithT assertion

* Change "EventuallyWithT" condition acceptance to no-errors raised

This change updates the "EventuallyWithT" assertion variants (regular, formatted,
requirement) to consider a condition as "met" if no assertion errors were raised
in a tick.

This allows to write easier conditions which simply contain assertions, without
needing to return a bool. The equivalent of a condition returning true in the
previous implementation would be a a condition with a single "assert.True(..)" call.

* Declare the "Collect.Copy(T)" method as a testing helper

* run go generate

---------

Co-authored-by: Arik Kfir <arik@kfirs.com>
2023-05-10 06:58:49 +10:00
Michael Pu c5fc9d6b6b
Compare public elements of struct (#1309)
* Implement checking only exported fields

Co-authored-by: Anthony Chang <anthony-chang@users.noreply.github.com>

* Update comment

* Run go generate

* Make compatiable with Go 1.16.5

* Fix go generate files

* Fix white space changes

* Fix whitespace changes

* Fix whitespace changes in gogenerate files

---------

Co-authored-by: Anthony Chang <anthony-chang@users.noreply.github.com>
2023-03-14 22:01:35 +10:00
Ruan Moolman 2fab6dffcf
Add WithinTimeRange method (#1188)
* Add WithinTimeRange method

* Run ./.ci.generate.sh

* Rename WithinTimeRange to WithinRange

* Rename WithinRange expected parameter to actual

* Capitalise start parameter at start of error message

* Improve WithinRange example
2022-06-28 21:14:39 +10:00
Alun Evans 6990a05d54 Add ErrorContains 2021-01-16 12:32:05 +11:00
Masaya Hayashi dc8af7208c add generated code for positive/negative assertion 2020-11-03 21:37:46 +11:00
alexpantyukhin c74c0d3a7f add fnctions into requres 2020-08-14 20:45:51 +10:00
Pal Sivertsen 95a9d909e9 Add wrapper functions for errors Is and As funcs
This commit adds wrapper functions for Is and As functions from the
errors package.
2020-07-20 20:40:44 +10:00
Boyan e2b269ecc5 This reverts commit 2adb7b54b7. 2020-06-05 20:47:15 +10:00
Boyan 656132404a This reverts commit 484fff1ace. 2020-06-05 20:47:15 +10:00
Ivo van der Wijk 004e3cb722 commit generated files 2020-05-27 08:39:56 +10:00
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
gohargasparyan 484fff1ace didn't notice should run go generate 2020-05-04 07:47:34 +10:00
gohargasparyan 2adb7b54b7 correct missing parameters in require and require_forward 2020-05-04 07:47:34 +10:00
Martijn 28b7455875 Ran go generate ./... 2020-04-06 07:42:56 +10: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
Boyan Soubachov 22d5528225 Fix InDelta docstring
* Fixed the docstring for the InDelta function.
2019-12-23 07:31:11 -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
Leigh McCulloch 9a14481b90 Add go generated files 2019-12-10 08:32:02 -07:00
Leigh McCulloch 7c5ac23b81 Make _codegen its own module so that its dependencies do not pollute the root modules dependency graph 2019-12-09 10:12:49 -07:00
Boyan Soubachov 37e2176163 Rerun go generate
* Added generated code for new assert & require tests
2019-12-03 09:34:43 -07:00
Boyan d2e1501cff Remove hand editing of generated code 2019-11-04 07:28:29 -07:00
Boyan db3bc60f5a Typo fix for require.NotSamef 2019-11-04 07:28:29 -07:00
Boyan 7088056203 Add NotSame
* Added NotSame test for the assert package
* Added NotSame test for the require package
* Included formatted variants of NotSame for both assert and require
2019-11-04 07:28:29 -07:00
Nobuhiro MIKI 0224ef258e Add YAMLEq to assert that two YAML strings are equivalent 2019-07-11 17:50:32 -06:00
Grzegorz Miejski d84e815d44 Introduce Eventually assertion. 2019-07-09 13:57:54 -06:00
Miles Steele ae5876d09a change report wording, fix int stringification, fix doc 2019-07-08 11:49:27 -06:00
Kirill Smelkov 34c6fa2dc7 assert, require: Regenerate
Run `go generate ...` from top of testify tree. This brings in wappers
for Greater, GreaterOrEqual, Less, LessOrEqual and Same.
2019-03-11 10:14:05 -06:00
Chris Marchbanks 78018b09cd Helper is called before assert function in require.* functions 2019-02-14 17:34:13 -07:00
Renato 282608cc76 update comment to match function name 2018-10-13 18:00:28 -06:00
Stephan Renatus 38eb60e591 http_assertions: regenerate
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-06-09 12:51:17 +01:00
Nick Pollett ef2d015404 Run generator 2018-06-09 10:23:57 +01:00
Nick Pollett 89226b8388 Compact template 2018-06-09 10:23:57 +01:00
Nick Pollett 6c9d18aaae Optimise template 2018-06-09 10:23:57 +01:00
Cory Bennett c679ae2cc0 add function aliases for common assert and requires function signatures to make table driven tests easier 2018-03-19 22:34:59 +00:00
Ernesto Jiménez a726187e31 Fix vim-go integration and other editors
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.
2018-02-02 18:39:40 +00:00
Ernesto Jiménez 12b6f73e60 Docs: Remove superfluous parenthesis
As per https://github.com/stretchr/testify/pull/549 from @larsxschneider
2018-01-31 22:38:42 +00:00
Ernesto Jiménez 87b1dfb5b2 Remove returns info from assertion docs
Fixes #525

Return information was propagated to the docs from other wrapper
functions which return nothing.
2017-12-31 13:42:24 +01:00
Ernesto Jiménez 8de2544b9a Fix HTTP assertions to be consistent with the rest
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
2017-12-30 18:45:31 +01:00
Ernesto Jiménez b57b6d191c Add FileExists and DirExists assertions
Implement FileExists and DirExists assertions to check whether file/dir
exist in a given path.

Closes #428
2017-12-30 18:26:00 +01:00
Emil Stanchev ae87ba6d08 Ran go generate 2017-12-30 16:33:25 +01:00
Tim Schaub 0c49dd9bb7 Replace is with in
Minor doc typo.
2017-12-30 16:16:00 +01:00
Jonathan Jin 249123e03a Implement delta comparison for map values 2017-12-30 14:26:37 +01:00
Tom Artale f6abca5936 Added assert.PanicsWithValue + tests 2017-06-01 22:03:22 +01:00
Adam Medzinski 46b3c8225b Simple validation of Equal/NotEqual assertion arguments 2017-05-29 17:57:31 +01:00