diff --git a/Makefile b/Makefile index 9d9707d..a76afd0 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,14 @@ all: dev dev: build - ./pastebin -bind 127.0.0.1:8000 + ./pastebin build: clean go get ./... - go build -o ./pastebin . + go build . + +test: + go test ./... clean: - rm -rf bin pastebin + rm -rf pastebin diff --git a/config_test.go b/config_test.go index aa628d8..4ae53cb 100644 --- a/config_test.go +++ b/config_test.go @@ -2,6 +2,7 @@ package main import ( "testing" + "time" "github.com/stretchr/testify/assert" ) @@ -10,14 +11,14 @@ func TestZeroConfig(t *testing.T) { assert := assert.New(t) cfg := Config{} - assert.Equal(cfg.expiry, 0) + assert.Equal(cfg.expiry, 0*time.Second) assert.Equal(cfg.fqdn, "") } func TestConfig(t *testing.T) { assert := assert.New(t) - cfg := Config{expiry: 1800, fqdn: "https://localhost"} - assert.Equal(cfg.expiry, 1800) + cfg := Config{expiry: 30 * time.Minute, fqdn: "https://localhost"} + assert.Equal(cfg.expiry, 30*time.Minute) assert.Equal(cfg.fqdn, "https://localhost") }