1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00

read tests

This commit is contained in:
Mike Farah
2020-10-13 13:17:18 +11:00
parent d19e9f6917
commit 829ca3b424
2 changed files with 19 additions and 7 deletions

View File

@@ -320,7 +320,7 @@ dog: bark
defer test.RemoveTempYamlFile(filename)
cmd := getRootCommand()
result := test.RunCmd(cmd, fmt.Sprintf("read -l %s", filename))
result := test.RunCmd(cmd, fmt.Sprintf("read %s count(*)", filename))
if result.Error != nil {
t.Error(result.Error)
}
@@ -336,7 +336,7 @@ func TestReadObjectLengthDeepCmd(t *testing.T) {
defer test.RemoveTempYamlFile(filename)
cmd := getRootCommand()
result := test.RunCmd(cmd, fmt.Sprintf("read -l %s holder", filename))
result := test.RunCmd(cmd, fmt.Sprintf("read %s count(holder.*)", filename))
if result.Error != nil {
t.Error(result.Error)
}
@@ -355,7 +355,7 @@ holderB:
defer test.RemoveTempYamlFile(filename)
cmd := getRootCommand()
result := test.RunCmd(cmd, fmt.Sprintf("read -l -c %s holder*", filename))
result := test.RunCmd(cmd, fmt.Sprintf("read %s count(holder*)", filename))
if result.Error != nil {
t.Error(result.Error)
}
@@ -374,7 +374,7 @@ holderB:
defer test.RemoveTempYamlFile(filename)
cmd := getRootCommand()
result := test.RunCmd(cmd, fmt.Sprintf("read -l -ppv %s holder*", filename))
result := test.RunCmd(cmd, fmt.Sprintf("read -ppv %s holder*.(count(*))", filename))
if result.Error != nil {
t.Error(result.Error)
}
@@ -387,7 +387,7 @@ func TestReadScalarLengthCmd(t *testing.T) {
defer test.RemoveTempYamlFile(filename)
cmd := getRootCommand()
result := test.RunCmd(cmd, fmt.Sprintf("read -l %s", filename))
result := test.RunCmd(cmd, fmt.Sprintf("read %s 'count(.)'", filename))
if result.Error != nil {
t.Error(result.Error)
}