Grokking Advanced Go
0% completed
Coverage and Examples
The method ShippingCents below has 100.0 percent test coverage. All three of its table rows pass, and it still charges 499 cents for an order of exactly 5,000 cents, which should ship free. The number and the bug are both real, and both come from the module on this page.
example/orders/order.go:27: ShippingCents 100.0%
That figure measures one fact: every statement in the method ran at least once during the tests. It says nothing about whether any statement was right. The operator > runs exactly as often as >= would, so no count of executed statements can tell them apart
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%