private/version: document kebabToPascal
Change-Id: Id7bdf969072c330956c093c24b662f4330fc4d4c
This commit is contained in:
parent
5fca07387f
commit
7aa001d62f
@ -126,6 +126,7 @@ func (client *Client) Process(ctx context.Context, processName string) (process
|
||||
return process, nil
|
||||
}
|
||||
|
||||
// kebabToPascal converts `alpha-beta` to `AlphaBeta`.
|
||||
func kebabToPascal(str string) string {
|
||||
return strings.ReplaceAll(cases.Title(language.Und, cases.NoLower).String(str), "-", "")
|
||||
}
|
||||
|
20
private/version/checker/util_test.go
Normal file
20
private/version/checker/util_test.go
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2022 Storj Labs, Inc.
|
||||
// See LICENSE for copying information.
|
||||
|
||||
package checker
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestKebabToPascal(t *testing.T) {
|
||||
require.Equal(t, "StoragenodeUpdater", kebabToPascal("StoragenodeUpdater"))
|
||||
require.Equal(t, "StoragenodeUpdater", kebabToPascal("storagenode-updater"))
|
||||
require.Equal(t, "Satellite", kebabToPascal("satellite"))
|
||||
require.Equal(t, "Storagenode", kebabToPascal("storagenode"))
|
||||
require.Equal(t, "Uplink", kebabToPascal("uplink"))
|
||||
require.Equal(t, "Gateway", kebabToPascal("gateway"))
|
||||
require.Equal(t, "Identity", kebabToPascal("identity"))
|
||||
}
|
Loading…
Reference in New Issue
Block a user