{"repo":"maxatome/go-testdeep","free":true,"listed":false,"github":"https://github.com/maxatome/go-testdeep","clone":"git clone https://github.com/maxatome/go-testdeep.git","description":"Extremely flexible golang deep comparison, extends the go testing package, tests HTTP APIs and provides tests suite","language":"Go","stars":463,"topics":["golang","golang-package","go","assertions","testing","toolkit","testdeep","framework","httptest","golang-testing"],"license":"BSD-2-Clause","category":"dev-tools","readme_excerpt":"go-testdeep =========== Extremely flexible golang deep comparison, extends the go testing package, dependency free. Currently supports go 1.16 → 1.27. - Latest news - Synopsis - Description - Installation - Functions - Available operators - Helpers - tdhttp or HTTP API testing helper - tdsuite or testing suite helper - tdsynctest or testing/synctest helper - tdutil aka the helper of helpers - See also - License - FAQ Latest news - 2025/02/18: v1.15.0 release; - 2023/12/27: v1.14.0 release; - 2023/03/18: v1.13.0 release; - see commits history for other/older changes. Synopsis Make golang tests easy, from simplest usage: To a bit more complex one, allowing flexible comparisons using TestDeep operators: Or anchoring operators directly in literals, as in: To most complex one, allowing to easily test HTTP API routes, using flexible operators: 1. the API handler ready to be tested; 2. the POST request with automatic JSON marshaling; 3. the expected response HTTP status should be http.StatusCreated and the line just below, the body should match the [ JSON ] operator; 4. some operators can be embedded, like [ Between ] here; 5. for the $id placeholder, [ Catch ] its value: put it in id variable and check it is [ NotZero ]; 6. for the $createdAt placeholder, use the [ All ] operator. It combines several operators like a AND; 7. check that $createdAt date ends with \"Z\" using [ HasSuffix ]. As we expect a RFC3339 date, we require it in UTC time zone; 8. convert $createdAt date into a ti","default_branch":null,"files":null,"tree":[],"storefront":"/r/maxatome","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/maxatome/go-testdeep/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}