1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/doc
Ryan Roden-Corrent b90bae79da
doc: document that test_ functions may propagate errors (#10162)
When testing a function that can return an error, writing a test like
this allows you to more easily test the non-error flow by just
propagating any errors and letting them fail the test.

I didn't realize this was a feature at first, so I was writing tests
like:

```
fn test_atoi() {
	assert strconv.atoi('1') or { panic("atoi failed") } == 1
	assert strconv.atoi('one') or { panic("atoi failed") } == 1
}
```
2021-05-21 14:18:13 +03:00
..
docs.md doc: document that test_ functions may propagate errors (#10162) 2021-05-21 14:18:13 +03:00
upcoming.md docs: remove & from shared initializers (#8499) 2021-02-01 21:43:45 +01:00