mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 13:40:38 +03:00
parent
32471b57bd
commit
d90e37e0c6
442 changed files with 1426 additions and 2254 deletions
|
@ -79,7 +79,6 @@ func (t testContentResource) Key() string {
|
|||
}
|
||||
|
||||
func TestUnmarshal(t *testing.T) {
|
||||
|
||||
v := viper.New()
|
||||
ns := New(newDeps(v))
|
||||
c := qt.New(t)
|
||||
|
@ -120,21 +119,17 @@ func TestUnmarshal(t *testing.T) {
|
|||
}},
|
||||
{testContentResource{key: "r1", content: `a;b;c`, mime: media.CSVType}, map[string]interface{}{"delimiter": ";"}, func(r [][]string) {
|
||||
c.Assert([][]string{{"a", "b", "c"}}, qt.DeepEquals, r)
|
||||
|
||||
}},
|
||||
{"a,b,c", nil, func(r [][]string) {
|
||||
c.Assert([][]string{{"a", "b", "c"}}, qt.DeepEquals, r)
|
||||
|
||||
}},
|
||||
{"a;b;c", map[string]interface{}{"delimiter": ";"}, func(r [][]string) {
|
||||
c.Assert([][]string{{"a", "b", "c"}}, qt.DeepEquals, r)
|
||||
|
||||
}},
|
||||
{testContentResource{key: "r1", content: `
|
||||
% This is a comment
|
||||
a;b;c`, mime: media.CSVType}, map[string]interface{}{"DElimiter": ";", "Comment": "%"}, func(r [][]string) {
|
||||
c.Assert([][]string{{"a", "b", "c"}}, qt.DeepEquals, r)
|
||||
|
||||
}},
|
||||
// errors
|
||||
{"thisisnotavaliddataformat", nil, false},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue