Files
gof3/tree/f3/path_test.go
Earl Warren fb2e7aad84 tree/f3: define f3.Path with additional accessors
So they can be used like so to go from the root down:

p.Root().Forge().Users()
2024-03-08 18:37:26 +07:00

28 lines
557 B
Go

// Copyright Earl Warren <contact@earl-warren.org>
// Copyright Loïc Dachary <loic@dachary.org>
// SPDX-License-Identifier: MIT
package f3
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestF3Path(t *testing.T) {
{
user := "user1"
p := NewUserPath(user)
assert.Equal(t, 4, p.Length())
assert.Equal(t, user, string(p.Root().Forge().Users().First().GetID()))
}
{
topic := "topic1"
p := NewTopicPath(topic)
assert.Equal(t, 4, p.Length())
assert.Equal(t, topic, string(p.Root().Forge().Topics().First().GetID()))
}
}