mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
Add test for isYamlFileExtension functions
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
This commit is contained in:
parent
4a944230ea
commit
06188f9dfe
2 changed files with 40 additions and 0 deletions
|
|
@ -439,3 +439,23 @@ items:
|
|||
t.Fatalf("List objects keep annotations should pass. got: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsYamlFileExtension(t *testing.T) {
|
||||
tests := []struct {
|
||||
filename string
|
||||
expected bool
|
||||
}{
|
||||
{"test.yaml", true},
|
||||
{"test.yml", true},
|
||||
{"test.txt", false},
|
||||
{"test", false},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
result := isYamlFileExtension(test.filename)
|
||||
if result != test.expected {
|
||||
t.Errorf("isYamlFileExtension(%s) = %v; want %v", test.filename, result, test.expected)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -439,3 +439,23 @@ items:
|
|||
t.Fatalf("List objects keep annotations should pass. got: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsYamlFileExtension(t *testing.T) {
|
||||
tests := []struct {
|
||||
filename string
|
||||
expected bool
|
||||
}{
|
||||
{"test.yaml", true},
|
||||
{"test.yml", true},
|
||||
{"test.txt", false},
|
||||
{"test", false},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
result := isYamlFileExtension(test.filename)
|
||||
if result != test.expected {
|
||||
t.Errorf("isYamlFileExtension(%s) = %v; want %v", test.filename, result, test.expected)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue