From db1d5cb19cd973708f6ff3e9e1cb37146866201b Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 28 Mar 2019 06:16:16 +0700 Subject: cmd/beku: use direct test functions instead of using sub-tests --- cmd/beku/command_test.go | 14 +++++--------- 1 file 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) -} -- cgit v1.3