Can Gomega print complete strings like ginkgo?

PHPz
Release: 2024-02-09 08:33:32
forward
548 people have browsed it

Can Gomega print complete strings like ginkgo?

php editor Yuzu Hello! Regarding the question you mentioned, Gomega and ginkgo are both popular testing frameworks in the Go language. While they have similarities in terms of testing, there are some differences in printing the complete string. In the case of Gomega, it provides some convenient functions and assertions, but when printing a string, only part of it is displayed, not the complete string. Ginkgo can print the complete string, which is very helpful for debugging and troubleshooting problems. Therefore, if you need to print the complete string, it is recommended to use ginkgo for testing. hope it is of help to you!

Question content

Error printing example of unit test:

expected
              <string>: "...up - finish..."
          to equal               |
              <string>: "...up - vault ..."
Copy after login

Is there a way to increase the printing limit, this is simply impractical... There were at least 100 signs or something like that...

edit: I may not have provided enough information:

Vault ...
Finish...
Copy after login

This is not the only different part of the string, if an error occurs it can be difficult to read without more context. There should be a way to allow full comparison printing shouldn't there? Similar to the situation in nodejs chai.

Solution

https://www.php.cn/link/e3c92f539bc17efbcc0c2e5229efa268Look at this, onsi replied. Check out the format package.

The above is the detailed content of Can Gomega print complete strings like ginkgo?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!