github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbfs/tlfhandle/path_test.go (about)

     1  // Copyright 2016 Keybase Inc. All rights reserved.
     2  // Use of this source code is governed by a BSD
     3  // license that can be found in the LICENSE file.
     4  
     5  package tlfhandle
     6  
     7  import (
     8  	"testing"
     9  
    10  	"github.com/stretchr/testify/assert"
    11  )
    12  
    13  func TestBuildCanonicalPath(t *testing.T) {
    14  	assert.Equal(t, "/keybase/public", BuildCanonicalPath(PublicPathType, ""))
    15  	assert.Equal(t, "/keybase/private", BuildCanonicalPath(PrivatePathType, ""))
    16  	assert.Equal(t, "/keybase/public/u1", BuildCanonicalPath(PublicPathType, "u1"))
    17  	assert.Equal(t, "/keybase/private/u2", BuildCanonicalPath(PrivatePathType, "u2"))
    18  	assert.Equal(t, "/keybase/private/u3", BuildCanonicalPath(PrivatePathType, "", "u3"))
    19  	assert.Equal(t, "/keybase/private/u3", BuildCanonicalPath(PrivatePathType, "u3", ""))
    20  	assert.Equal(t, "/keybase/hi.txt", BuildCanonicalPath(KeybasePathType, "hi.txt"))
    21  }