mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
small fixes
This commit is contained in:
parent
cc6cbc7d47
commit
32b92611a7
@ -4,8 +4,6 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/tarampampam/error-pages/internal/tpl"
|
|
||||||
|
|
||||||
"github.com/fasthttp/router"
|
"github.com/fasthttp/router"
|
||||||
"github.com/tarampampam/error-pages/internal/checkers"
|
"github.com/tarampampam/error-pages/internal/checkers"
|
||||||
"github.com/tarampampam/error-pages/internal/config"
|
"github.com/tarampampam/error-pages/internal/config"
|
||||||
@ -17,6 +15,7 @@ import (
|
|||||||
notfoundHandler "github.com/tarampampam/error-pages/internal/http/handlers/notfound"
|
notfoundHandler "github.com/tarampampam/error-pages/internal/http/handlers/notfound"
|
||||||
versionHandler "github.com/tarampampam/error-pages/internal/http/handlers/version"
|
versionHandler "github.com/tarampampam/error-pages/internal/http/handlers/version"
|
||||||
"github.com/tarampampam/error-pages/internal/metrics"
|
"github.com/tarampampam/error-pages/internal/metrics"
|
||||||
|
"github.com/tarampampam/error-pages/internal/tpl"
|
||||||
"github.com/tarampampam/error-pages/internal/version"
|
"github.com/tarampampam/error-pages/internal/version"
|
||||||
"github.com/valyala/fasthttp"
|
"github.com/valyala/fasthttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
@ -44,3 +44,23 @@ func TestProperties_Replaces(t *testing.T) {
|
|||||||
assert.Equal(t, "", r["message"])
|
assert.Equal(t, "", r["message"])
|
||||||
assert.Equal(t, "", r["description"])
|
assert.Equal(t, "", r["description"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestProperties_Hash(t *testing.T) {
|
||||||
|
props1 := tpl.Properties{Code: "123"}
|
||||||
|
props2 := tpl.Properties{Code: "123"}
|
||||||
|
|
||||||
|
hash1, err := props1.Hash()
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
hash2, err := props2.Hash()
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
assert.Equal(t, hash1, hash2)
|
||||||
|
|
||||||
|
props2.Code = "321"
|
||||||
|
|
||||||
|
hash2, err = props2.Hash()
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
assert.NotEqual(t, hash1, hash2)
|
||||||
|
}
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/tarampampam/error-pages/internal/version"
|
"github.com/tarampampam/error-pages/internal/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user