Kindsys: Unify plugins, pfs with kind framework (#61192)
* New pfs impl * Reached codegen parity with old system * Update all models.cue inputs * Rename all models.cue files * Remove unused prefixfs * Changes Queries->DataQuery schema interface * Recodegen * All tests passing, nearly good now * Add SchemaInterface to kindsys props * Add pascal name deriver * Relocate plugin cue files again * Clarify use of injected fields * Remove unnecessary aliasing * Move DataQuery into mudball * Allow forcing ExpandReferences on go type generation * Move DataQuery def into kindsys, add generator to copy it to common * Fix copy generator to replace package name correctly * Fix duplicate type, test failure * Fix linting issues
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
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))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user