ZhangZhihui's Blog |
|
||
2023年10月18日
摘要:
Problem: You want to run performance tests for a specific duration or a specific number of iterations. Solution: You can increase the minimum duration 阅读全文
摘要:
Problem: You want to customize the performance tests to avoid benchmarking test fixtures. Solution: You can start, stop, and reset the benchmark timer 阅读全文
摘要:
Problem: You want to do unit testing on a web application or a web service. Solution: Use the httptest.NewRecorder function to create an httptest.Resp 阅读全文
摘要:
Problem: You want to generate random test data for running your test functions. Solution: Use fuzzing , which is an automated testing technique to gen 阅读全文
摘要:
Problem: You want to speed up testing by running tests in parallel. Solution: Use the t.Parallel function to enable tests or subtests to run in parall 阅读全文
摘要:
Problem: You want to create subtests within a test function to have finer control over test cases. Solution: Use the t.Run function to create subtests 阅读全文
摘要:
Problem: You want to set up data and an environment for testing and tear it down after the test is run. Solution: You can create helper functions or u 阅读全文
|
Copyright © 2024 ZhangZhihuiAAA
Powered by .NET 9.0 on Kubernetes |