Add on_write_buffer_drained
This commit is contained in:
15
style.md
15
style.md
@@ -522,6 +522,21 @@ TEST_CASE("Server accepts connections") {
|
||||
// TEST_CASE("Server creates epoll instance") { /* implementation detail */ }
|
||||
```
|
||||
|
||||
### What NOT to Test
|
||||
|
||||
**Avoid testing language features and plumbing:**
|
||||
- Don't test that virtual functions dispatch correctly
|
||||
- Don't test that standard library types work (unique_ptr, containers, etc.)
|
||||
- Don't test basic constructor/destructor calls
|
||||
|
||||
**Test business logic instead:**
|
||||
- When does your code call hooks/callbacks and why?
|
||||
- What state transitions trigger behavior changes?
|
||||
- How does your code handle error conditions?
|
||||
- What promises does your API make to users?
|
||||
|
||||
**Ask: "Am I testing the C++ compiler or my application logic?"**
|
||||
|
||||
### Test Synchronization (Authoritative Rules)
|
||||
- **ABSOLUTELY NEVER use timeouts** (`sleep_for`, `wait_for`, etc.)
|
||||
- **Deterministic synchronization only:**
|
||||
|
||||
Reference in New Issue
Block a user