Storage: add basic storage service (#46604)

This commit is contained in:
Ryan McKinley
2022-03-17 10:19:23 -07:00
committed by GitHub
parent 4df7bf5ab2
commit 1cfb9a4a19
25 changed files with 705 additions and 166 deletions
+25
View File
@@ -0,0 +1,25 @@
package store
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestUtils(t *testing.T) {
a, b := splitFirstSegment("")
require.Equal(t, "", a)
require.Equal(t, "", b)
a, b = splitFirstSegment("hello")
require.Equal(t, "hello", a)
require.Equal(t, "", b)
a, b = splitFirstSegment("hello/world")
require.Equal(t, "hello", a)
require.Equal(t, "world", b)
a, b = splitFirstSegment("/hello/world") // strip leading slash
require.Equal(t, "hello", a)
require.Equal(t, "world", b)
}