Improve setter output message

This commit is contained in:
Phani Teja Marupaka
2020-10-06 14:41:14 -07:00
parent 68f67c183e
commit c96fa7c347
2 changed files with 5 additions and 5 deletions

View File

@@ -173,7 +173,7 @@ func (r *SetRunner) executeCmd(w io.Writer, pkgPath string) error {
fmt.Fprintf(w, "%s\n", err.Error()) fmt.Fprintf(w, "%s\n", err.Error())
} }
} else { } else {
fmt.Fprintf(w, "set %d field(s)\n", count) fmt.Fprintf(w, "set %d field(s) of setter %q to value %q\n", count, r.Set.Name, r.Set.Value)
} }
return nil return nil
} }

View File

@@ -1094,13 +1094,13 @@ func TestSetSubPackages(t *testing.T) {
dataset: "dataset-with-setters", dataset: "dataset-with-setters",
args: []string{"namespace", "otherspace", "-R"}, args: []string{"namespace", "otherspace", "-R"},
expected: `${baseDir}/mysql/ expected: `${baseDir}/mysql/
set 1 field(s) set 1 field(s) of setter "namespace" to value "otherspace"
${baseDir}/mysql/nosetters/ ${baseDir}/mysql/nosetters/
setter "namespace" is not found setter "namespace" is not found
${baseDir}/mysql/storage/ ${baseDir}/mysql/storage/
set 1 field(s) set 1 field(s) of setter "namespace" to value "otherspace"
`, `,
}, },
{ {
@@ -1109,7 +1109,7 @@ set 1 field(s)
packagePath: "mysql", packagePath: "mysql",
args: []string{"namespace", "otherspace"}, args: []string{"namespace", "otherspace"},
expected: `${baseDir}/mysql/ expected: `${baseDir}/mysql/
set 1 field(s) set 1 field(s) of setter "namespace" to value "otherspace"
`, `,
}, },
{ {
@@ -1118,7 +1118,7 @@ set 1 field(s)
packagePath: "mysql/storage", packagePath: "mysql/storage",
args: []string{"namespace", "otherspace"}, args: []string{"namespace", "otherspace"},
expected: `${baseDir}/mysql/storage/ expected: `${baseDir}/mysql/storage/
set 1 field(s) set 1 field(s) of setter "namespace" to value "otherspace"
`, `,
}, },
} }