今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Challenge 7: Write some tests
- [Instructor] All right. This challenge will have you write table-driven tests for the counters that we used back in the interfaces challenge, mainly the letter counter, the number counter, and the symbol counter. For your convenience, I've put these counters in their count methods in the same challenge directory in the begin directory where you have your main .go file. So this is them right here. The main_test.go file is also in that directory, ready for you to start writing your tests in. Here's what I'm looking for. You're going to have a test letter count, test number count, and test symbol count function in your test file. Each one of those tests is going to use the appropriate number of test cases. And lastly, you are going to make use of subtests to test each test case in your functions. And your sample output should look something like this, where we have the test case nicely delineating every single test case…