How to run test cases in a specified file?

前端 未结 7 1628
孤独总比滥情好
孤独总比滥情好 2020-12-04 05:30

My package test cases are scattered across multiple files, if I run go test it runs all test cases in the package.

It is unnecessar

7条回答
  •  眼角桃花
    2020-12-04 06:15

    alias testcases="sed -n 's/func.*\(Test.*\)(.*/\1/p' | xargs | sed 's/ /|/g'"
    
    go test -v -run $(cat coordinator_test.go | testcases)
    

提交回复
热议问题