官术网_书友最值得收藏!

Running tests in addInt_test.go

Let's now run the tests in this file, and we are expecting each of the row in the testCases table, which we ran, to be treated as a separate test:

$ go test -v ./{addInt.go,addInt_test.go}                           
=== RUN   TestAddInt                       
=== RUN   TestAddInt/addInt()_->_0         
=== RUN   TestAddInt/addInt([]int{10,_20,_100})_->_130                                
--- PASS: TestAddInt (0.00s)               
    --- PASS: TestAddInt/addInt()_->_0 (0.00s)                                        
        addInt_test.go:23: 0 == 0          
    --- PASS: TestAddInt/addInt([]int{10,_20,_100})_->_130 (0.00s)                    
        addInt_test.go:23: 130 == 130      
PASS                                       
ok      command-line-arguments  0.001s       
主站蜘蛛池模板: 伊春市| 时尚| 广丰县| 东莞市| 高邮市| 鄂温| 沈丘县| 龙胜| 县级市| 长海县| 即墨市| 琼海市| 武威市| 长沙县| 花莲市| 普陀区| 来凤县| 米易县| 叶城县| 滦平县| 鄂伦春自治旗| 达尔| 彭水| 枞阳县| 邵阳县| 金沙县| 浪卡子县| 增城市| 孝感市| 鹰潭市| 南京市| 托里县| 东源县| 会昌县| 黔东| 龙南县| 余庆县| 邢台县| 丘北县| 枣庄市| 馆陶县|