MCPcopy Create free account
hub / github.com/conforma/cli / TestIsYamlMap

Function TestIsYamlMap

internal/utils/helpers_test.go:78–107  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestIsYamlMap(t *testing.T) {
79 tests := []struct {
80 name string
81 data string
82 want bool
83 }{
84 {
85 name: "valid YAML",
86 data: `name: ec`,
87 want: true,
88 },
89 {
90 name: "invalid YAML",
91 data: `name: ec\nblah:`,
92 want: false,
93 },
94 {
95 name: "empty string",
96 data: "",
97 want: false,
98 },
99 }
100
101 for _, tt := range tests {
102 t.Run(tt.name, func(t *testing.T) {
103 got := IsYamlMap(tt.data)
104 assert.Equal(t, tt.want, got)
105 })
106 }
107}
108
109func TestIsFile(t *testing.T) {
110 fs := afero.NewMemMapFs()

Callers

nothing calls this directly

Calls 2

IsYamlMapFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected