# 42 测试

- [基本测试](https://denglj.gitbook.io/essential-go/common-standard-libraries/42-testing/basic-test.md)
- [表格驱动的单元测试](https://denglj.gitbook.io/essential-go/common-standard-libraries/42-testing/table-driven-unit-tests.md)
- [使用setUp和tearDown函数](https://denglj.gitbook.io/essential-go/common-standard-libraries/42-testing/testing-using-setup-and-teardown-function.md)
- [性能测试](https://denglj.gitbook.io/essential-go/common-standard-libraries/42-testing/benchmarks.md)
- [样例测试(自注释测试)](https://denglj.gitbook.io/essential-go/common-standard-libraries/42-testing/example-tests-self-documenting-tests.md)
- [测试HTTP请求](https://denglj.gitbook.io/essential-go/common-standard-libraries/42-testing/testing-http-requests.md)
- [在测试中设置/重置模拟(mock)函数](https://denglj.gitbook.io/essential-go/common-standard-libraries/42-testing/set-reset-mock-function-in-tests.md)
- [以HTML格式查看代码覆盖率](https://denglj.gitbook.io/essential-go/common-standard-libraries/42-testing/view-code-coverage-in-html-format.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://denglj.gitbook.io/essential-go/common-standard-libraries/42-testing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
