summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2019-03-28 06:16:16 +0700
committerShulhan <ms@kilabit.info>2019-03-30 03:33:31 +0700
commitdb1d5cb19cd973708f6ff3e9e1cb37146866201b (patch)
tree0953261393d4f0d2addb8e927e94d7ab3d9ca288
parentce33f449bb52395325396b08faf872564ef21d30 (diff)
downloadbeku-db1d5cb19cd973708f6ff3e9e1cb37146866201b.tar.xz
cmd/beku: use direct test functions instead of using sub-tests
-rw-r--r--cmd/beku/command_test.go14
1 files changed, 5 insertions, 9 deletions
diff --git a/cmd/beku/command_test.go b/cmd/beku/command_test.go
index cae8e55..e2ca749 100644
--- a/cmd/beku/command_test.go
+++ b/cmd/beku/command_test.go
@@ -12,7 +12,7 @@ import (
"github.com/shuLhan/share/lib/test"
)
-func testParseFlags(t *testing.T) {
+func TestParseFlags(t *testing.T) {
cases := []struct {
args []string
expErr string
@@ -264,7 +264,7 @@ func testParseFlags(t *testing.T) {
}
}
-func testNewCommand(t *testing.T) {
+func TestNewCommand(t *testing.T) {
cases := []struct {
desc string
gopath string
@@ -277,8 +277,9 @@ func testNewCommand(t *testing.T) {
"beku", "-S", "A",
},
expCmd: &command{
- op: opSync,
- pkgs: []string{"A"},
+ op: opSync,
+ pkgs: []string{"A"},
+ firstTime: true,
},
}, {
desc: "With sync operation and no database found",
@@ -331,8 +332,3 @@ func testNewCommand(t *testing.T) {
os.Args = orgArgs
}
}
-
-func TestCommand(t *testing.T) {
- t.Run("parseFlags", testParseFlags)
- t.Run("newCommand", testNewCommand)
-}