mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-12-24 12:57:56 +08:00
19 lines
325 B
Go
19 lines
325 B
Go
package setup
|
|
|
|
import (
|
|
"fmt"
|
|
"strconv"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestFormatAlphaNum(t *testing.T) {
|
|
value := int64(999)
|
|
n := 5
|
|
s1 := strings.ToUpper(fmt.Sprintf("%0"+strconv.Itoa(n)+"s", strconv.FormatInt(value, 36)))
|
|
s2 := FormatInt36(value, n)
|
|
require.Equal(t, s1, s2)
|
|
}
|