mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-08 06:45:38 +00:00
add a test for file ext based format detection
This commit is contained in:
parent
0e7f9ad4f6
commit
6298fe0f1a
@ -50,3 +50,13 @@ func TestFormatFromString(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFormatStringFromFilename(t *testing.T) {
|
||||
test.AssertResult(t, "yaml", FormatStringFromFilename("test.Yaml"))
|
||||
test.AssertResult(t, "yaml", FormatStringFromFilename("test.index.Yaml"))
|
||||
test.AssertResult(t, "yaml", FormatStringFromFilename("test"))
|
||||
test.AssertResult(t, "json", FormatStringFromFilename("test.json"))
|
||||
test.AssertResult(t, "json", FormatStringFromFilename("TEST.JSON"))
|
||||
test.AssertResult(t, "yaml", FormatStringFromFilename("test.json/foo"))
|
||||
test.AssertResult(t, "yaml", FormatStringFromFilename(""))
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user