Skip to content

Commit 26541da

Browse files
committed
Added Diagnostic and Diagnosticf.
These produce diagnostic output, as defined by the TAP spec.
1 parent c2e1191 commit 26541da

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

util/tap.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,13 @@ func (t *T) Count() int {
111111
func (t *T) AutoPlan() {
112112
t.printf("1..%d\n", t.Count())
113113
}
114+
115+
// Diagnostic generates a diagnostic from the message.
116+
func (t *T) Diagnostic(message string) {
117+
t.printf("# %s\n", message)
118+
}
119+
120+
// Diagnosticf generates a diagnostic from the format string and arguments.
121+
func (t *T) Diagnosticf(format string, a ...interface{}) {
122+
t.printf("# "+format+"\n", a...)
123+
}

0 commit comments

Comments
 (0)