Commit Graph

792 Commits (07dc7ee5abe6d1c0ef6449f731ca9bf08e1787f8)

Author SHA1 Message Date
dependabot[bot] 07dc7ee5ab
Bump actions/setup-go from 3.1.0 to 3.2.0 (#1191)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-20 20:32:41 +10:00
dependabot[bot] c33fc8d30d
Bump actions/checkout from 2 to 3 (#1163)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-20 20:23:43 +10:00
Boyan Soubachov 3c33e07c4c
Added Go 1.18.1 as a build/supported version (#1182)
* Added Go 1.18.1 as a build/supported version
Removed Go 1.15.13 as a build version as it's no longer supported

* Fix mutex passed by value for the Mock struct

* Add mutex initialisation for Mock

Co-authored-by: Boyan Soubachov <bsoubachov@atlassian.com>
2022-06-14 20:50:25 +10:00
dependabot[bot] e2b56b3a38 Bump github.com/stretchr/objx from 0.1.0 to 0.4.0
Bumps [github.com/stretchr/objx](https://github.com/stretchr/objx) from 0.1.0 to 0.4.0.
- [Release notes](https://github.com/stretchr/objx/releases)
- [Commits](https://github.com/stretchr/objx/compare/v0.1.0...v0.4.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/objx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 20:44:02 +10:00
Karol Lassak 41453c009a Update gopkg.in/yaml.v3 2022-06-06 19:52:45 +10:00
Jeff Widman 285adcc5ce Update go versions in build matrix
These are the latest versions listed on https://go.dev/dl/
2022-05-13 21:12:09 +10:00
dependabot[bot] 6e7fab43fc Bump actions/setup-go from 2 to 3.1.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.1.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3.1.0)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 21:10:54 +10:00
Weizhen Wang 106ec21d14 use RWMutex
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
2022-05-04 20:46:29 +10:00
Weizhen Wang a409ccf19e fix data race in the suit
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
2022-05-04 20:46:29 +10:00
cuishuang 35864782d2 assert: fix typo
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-05-04 20:29:57 +10:00
Jeff Widman 7797738693 Update versions supported to include `go 1.16`
Rather than directly adding `1.16`, I thought better to reword to state the minimum version supported... this way the line doesn't have to get updated with every new release, but instead only when dropping releases.
2022-03-17 22:47:27 +10:00
RmbRT 083ff1c044 Fixed didPanic to now detect panic(nil).
Previously, the function would not detect panic(nil) calls.
In didPanic, removed the anonymous function call, instead,
added named return values. Added extra test cases for the
panic(nil) call.
2022-03-16 07:08:43 +10:00
Torkel Rogstad 1e36bfe104 Use cross Go version compatible build tag syntax 2022-02-15 20:26:04 +10:00
Torkel Rogstad e798dc2763 Add docs on 1.17 build tags 2022-02-15 20:26:04 +10:00
Torkel Rogstad 83198c2c50 assert: guard CanConvert call in backward compatible wrapper 2022-02-15 20:26:04 +10:00
Torkel Rogstad 087b655c75 assert: allow comparing time.Time 2022-02-15 20:26:04 +10:00
Ilia Kravets 7bcf74e94f fix msgAndArgs forwarding 2022-02-10 20:09:05 +10:00
Ilia Kravets c29de71342 add tests for correct msgAndArgs forwarding
len(msgAndArgs)>1 should lead to fmt.Sprintf()
2022-02-10 20:09:05 +10:00
Boyan Soubachov f87e2b2119 Update builds
* Add Go 1.17.6 to the build versions
* Remove Go 1.14
* Remove unused TravisCI file
2022-02-10 20:07:02 +10:00
Menno ab6dc32628 fix linting errors in /assert package 2021-08-24 21:55:23 +10:00
Menno edff5a049b fix funtion name 2021-08-24 21:55:23 +10:00
Menno 5c61ef97ae fix potential nil-pointer dereference
the fix gracefully fails the assertion instead of panicking unresolved.
2021-08-24 21:55:23 +10:00
perrydunn e209ca88af Improve mock.MatchedBy failed comparison Diff message 2021-08-24 20:26:52 +10:00
Matthieu MOREL a9de4f065a Create dependabot.yml 2021-07-20 16:55:38 +02:00
Menno fd9e1fb0e1 Fix NaN similarity checks
Plus minor alignments in code.
2021-07-09 20:35:46 +10:00
Boyan Soubachov ee42bbe4ab Use multiple run commands 2021-07-08 22:18:43 +10:00
Boyan Soubachov 57bf675175 Update go versions 2021-07-08 22:18:43 +10:00
Boyan Soubachov 6c59e0f73d Convert CI to use GitHub Actions 2021-07-08 22:18:43 +10:00
neilisaac 6241f9ab99 Add String method to Mock to fix #625 2021-04-27 21:38:32 +10:00
Harald Nordgren dc5c261377 Make sure time.Time comparison produces a helpful diff. closes #989 2021-04-27 21:16:43 +10:00
Alun Evans 6990a05d54 Add ErrorContains 2021-01-16 12:32:05 +11:00
Yongxin Wang bf646ea5b3 add test to check that Helper is called 2021-01-15 21:06:28 +11:00
Yongxin Wang 6f81fdf1db fix the output source file in test output 2021-01-15 21:06:28 +11:00
Tomáš Procházka a2f7dbf150 Change Readme to reflect supported Go versions 2021-01-15 21:03:40 +11:00
Bo Sunesen acba37e5db Only use repeatability if no repeatability left 2021-01-13 20:54:11 +11:00
Bo Sunesen eb8c41ec07 Add more tests to mock package 2021-01-13 20:54:11 +11:00
Bo Sunesen a5830c56d3 Extract method to evaluate closest match 2021-01-13 20:54:11 +11:00
Bo Sunesen 1962448488 Use Repeatability as tie-breaker for closest match 2021-01-13 20:54:11 +11:00
Acho Arnold 92707c0b2d Fixed the link to not point to assert only 2020-11-03 21:39:35 +11:00
Acho Arnold 05dd0b2b35 Updated the readme to point to pkg.dev 2020-11-03 21:39:35 +11:00
Graham Jenson c26b7f39f8 Update assertions.go
lower to 10
2020-11-03 21:38:56 +11:00
Graham Jenson 8fb4b2442e [Fix] The most recent changes to golang/protobuf breaks the spew Circular data structure detection
The latest update to golang/protobuf (I am on v1.4.2) break the spew circular data structure detection. This means that when calling `assert.Equal(t, proto1, proto2)` will not only fail, but also enter an infinite recursion.

Given spew is not being actively maintained, and tesitfy should set some upper bound, we need to set a `MaxDepth` to some very high number, so at least the test will not run for a very long time and finish and fail quickly.
2020-11-03 21:38:56 +11:00
Masaya Hayashi dc8af7208c add generated code for positive/negative assertion 2020-11-03 21:37:46 +11:00
Masaya Hayashi 1544508911 add assert positive/negative 2020-11-03 21:37:46 +11:00
RyuseiNomi 54d05a4e18 modify function name and docstrings 2020-08-18 21:58:29 +10:00
RyuseiNomi 44accac0f5 revise test case name of example of mock section 2020-08-18 21:58:29 +10:00
alexpantyukhin cf221cc875 add tests and fix message 2020-08-14 20:45:51 +10:00
alexpantyukhin c74c0d3a7f add fnctions into requres 2020-08-14 20:45:51 +10:00
alexpantyukhin a9284e66a9 add assertion order 2020-08-14 20:45:51 +10:00
Martijn a3bed97cf3 assert: s/rune/r/ to avoid "rune" predeclared ident shadowing #642
Thanks @quasllyte
2020-08-03 19:54:30 +10:00