3 ms·
I just added a comment to the CloudFlare blog about 'semi mocking'. In go, functions are first class. You can assign them to variables. Using this, you can 'ho
by tonyhb 12y ago
I just added a comment to the CloudFlare blog about 'semi mocking'. In go, functions are first class. You can assign them to variables.
Using this, you can 'hot swap' methods in your tests to check for each different scenario. Here's an example: https://gist.github.com/tonyhb/8153e1fe10891c68a8c5 https://gist.github.com/tonyhb/8153e1fe10891c68a8c5
By changing the value of 'n' in each test you can check any failure scenario you need to. It's really, really awesome.