Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/utils/tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ function throws($function, $exceptionname, $infunction = null) {
if (strcasecmp($function, $infunction) == 0) {
printf("OK: Got %s thrown from %s\n", $exceptionname, $infunction);
} else {
printf("ALMOST: Got %s - but was thrown in %s, not %s\n", $exceptionname, $function, $infunction);
printf("ALMOST: Got %s - but was thrown in %s, not %s (%s)\n", $exceptionname, $function, $infunction, $e->getMessage());
}
return $e->getMessage();
}
printf("OK: Got %s\n", $exceptionname);
} else {
printf("ALMOST: Got %s - expected %s\n", get_class($e), $exceptionname);
printf("ALMOST: Got %s - expected %s: %s\n", get_class($e), $exceptionname, $e->getMessage());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjori: Are you asking for an rtrim() (or rtrim("\r\n")) call on the exception message parameters to printf()? If so, I can make that change tomorrow morning and merge this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No ... That will only trim trailing new lines, not in the middle of the message

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What components are creating messages with newlines (not sure I've seen those before).

And a second question: is this just to allow %s in EXPECTF blocks, instead of requiring multi-line catch-alls?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSL, SASL, and I think mongoc compounds some error message somewhere, although its been a while so maybe not.

Its about being all in one line yes, so you can differentiate what is coming from what in the output.

}
return $e->getMessage();
}
Expand Down