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

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       
主站蜘蛛池模板: 庆云县| 新丰县| 明溪县| 鲁山县| 九龙城区| 武陟县| 湘阴县| 攀枝花市| 皋兰县| 平罗县| 阿克陶县| 霍城县| 合水县| 合水县| 林芝县| 姚安县| 嵊州市| 临澧县| 龙泉市| 永平县| 卢氏县| 磐石市| 镇安县| 华安县| 延长县| 商河县| 海原县| 上虞市| 万宁市| 天镇县| 华蓥市| 宾阳县| 乌鲁木齐市| 茂名市| 陵川县| 红安县| 石渠县| 东辽县| 余江县| 巴塘县| 潼南县|