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

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       
主站蜘蛛池模板: 大冶市| 得荣县| 定襄县| 河南省| 井冈山市| 崇左市| 博罗县| 岳阳县| 凤阳县| 平湖市| 新竹县| 玉溪市| 连州市| 襄樊市| 陈巴尔虎旗| 镇坪县| 黄平县| 晋江市| 贡嘎县| 阜新市| 旬邑县| 辽宁省| 隆回县| 湖北省| 襄樊市| 仪征市| 姚安县| 岳池县| 大余县| 托克逊县| 柳河县| 兰溪市| 稷山县| 曲阳县| 武穴市| 剑阁县| 喀什市| 长岭县| 盐山县| 泰和县| 宜丰县|