The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/plugins/plugindef/pascal_test.go

43 lines
744 B

package plugindef
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestDerivePascal(t *testing.T) {
table := []struct {
id, name, out string
}{
{
name: "-- Grafana --",
out: "Grafana",
},
{
name: "A weird/Thing",
out: "AWeirdThing",
},
{
name: "/",
out: "Empty",
},
{
name: "some really Long thing WHY would38883 anyone do this i don't know but hey It seems like it this is just going on and",
out: "SomeReallyLongThingWHYWouldAnyoneDoThisIDonTKnowButHeyItSeemsLi",
},
}
for _, row := range table {
if row.id == "" {
row.id = "default-empty-panel"
}
pd := PluginDef{
Id: row.id,
Name: row.name,
}
require.Equal(t, row.out, DerivePascalName(pd))
}
}