mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-13 22:38:04 +00:00
More tests
This commit is contained in:
parent
124c57f9d9
commit
373e0a5eb7
2
.gitignore
vendored
2
.gitignore
vendored
@ -20,7 +20,7 @@ _cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
|
||||
_testmain.go
|
||||
|
||||
coverage.out
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
|
@ -215,3 +215,19 @@ b:
|
||||
b := entryInSlice(updated, "b").Value
|
||||
assertResult(t, "4", fmt.Sprintf("%v", b))
|
||||
}
|
||||
|
||||
func TestWriteMap_no_paths(t *testing.T) {
|
||||
var data = parseData(`
|
||||
b: 5
|
||||
`)
|
||||
|
||||
result := writeMap(data, []string{}, 4)
|
||||
assertResult(t, fmt.Sprintf("%v", data), fmt.Sprintf("%v", result))
|
||||
}
|
||||
|
||||
func TestWriteArray_no_paths(t *testing.T) {
|
||||
var data = make([]interface{}, 1)
|
||||
data[0] = "mike"
|
||||
result := writeArray(data, []string{}, 4)
|
||||
assertResult(t, fmt.Sprintf("%v", data), fmt.Sprintf("%v", result))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user