diff --git a/server/main.go b/server/main.go index da6a1fd..ca3ef36 100644 --- a/server/main.go +++ b/server/main.go @@ -125,6 +125,7 @@ func (s *Server) Start(p *cli.Context) (err error) { return nil } +// Websocket projects func (s *Server) projects(c echo.Context) error { websocket.Handler(func(ws *websocket.Conn) { defer ws.Close() diff --git a/settings/io_test.go b/settings/io_test.go index 2e55512..a45d6e0 100755 --- a/settings/io_test.go +++ b/settings/io_test.go @@ -40,4 +40,4 @@ func TestSettings_Create(t *testing.T) { } f := s.Create(p, "io_test") os.Remove(f.Name()) -} \ No newline at end of file +} diff --git a/style/style_test.go b/style/style_test.go index 087b228..7c15d26 100644 --- a/style/style_test.go +++ b/style/style_test.go @@ -1,8 +1,8 @@ package style import ( - "fmt" "bytes" + "fmt" "testing" ) @@ -15,7 +15,7 @@ func TestColorBase_Regular(t *testing.T) { } result := c.Regular(input) expected := fmt.Sprint(input) - if !bytes.Equal([]byte(result), []byte(expected)){ + if !bytes.Equal([]byte(result), []byte(expected)) { t.Error("Expected:", expected, "instead", result) } } @@ -29,7 +29,7 @@ func TestColorBase_Bold(t *testing.T) { } result := c.Bold(input) expected := fmt.Sprint(input) - if !bytes.Equal([]byte(result), []byte(expected)){ + if !bytes.Equal([]byte(result), []byte(expected)) { t.Error("Expected:", expected, "instead", result) } } diff --git a/watcher/utils_test.go b/watcher/utils_test.go new file mode 100644 index 0000000..03f69a7 --- /dev/null +++ b/watcher/utils_test.go @@ -0,0 +1,18 @@ +package watcher + +import ( + "flag" + "gopkg.in/urfave/cli.v2" + "testing" +) + +func TestArgsParam(t *testing.T) { + set := flag.NewFlagSet("test", 0) + set.Bool("myflag", false, "doc") + params := cli.NewContext(nil, set, nil) + set.Parse([]string{"--myflag", "bat", "baz"}) + result := argsParam(params) + if len(result) != 2 { + t.Fatal("Expected 2 instead", len(result)) + } +}