mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-05 14:07:01 +00:00
14 lines
306 B
Go
14 lines
306 B
Go
|
package utils
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestTrimHostPort(t *testing.T) {
|
||
|
assert.EqualValues(t, "aa", TrimHostPort([]byte("aa")))
|
||
|
assert.EqualValues(t, "", TrimHostPort([]byte(":")))
|
||
|
assert.EqualValues(t, "example.com", TrimHostPort([]byte("example.com:80")))
|
||
|
}
|