eclipse/lib/gitcache/url_ns_test.go

24 lines
478 B
Go
Raw Normal View History

// Copyright (C) 2024 Umorpha Systems
// SPDX-License-Identifier: AGPL-3.0-or-later
package gitcache_test
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"git.mothstuff.lol/lukeshu/eclipse/lib/gitcache"
)
func FuzzRoundTripURL(f *testing.F) {
f.Fuzz(func(t *testing.T, url string) {
url = strings.TrimRight(url, "/")
t.Logf("url = %q", url)
ns := gitcache.URL2NS(url)
t.Logf("ns = %q", ns)
assert.Equal(t, url, gitcache.NS2URL(ns))
})
}