[geary/wip/726281-text-attachment-crlf: 3/13] Add TestCase.assert_null_string method.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/726281-text-attachment-crlf: 3/13] Add TestCase.assert_null_string method.
- Date: Fri, 18 May 2018 23:27:17 +0000 (UTC)
commit 587e4e75962026ed1846f239dbb68d3d990e3ca5
Author: Michael James Gratton <mike vee net>
Date: Sat May 5 12:04:26 2018 +1000
Add TestCase.assert_null_string method.
test/test-case.vala | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/test/test-case.vala b/test/test-case.vala
index 759962d..1d72561 100644
--- a/test/test-case.vala
+++ b/test/test-case.vala
@@ -62,6 +62,18 @@ public void assert_string(string expected, string? actual, string? context = nul
}
}
+public void assert_null_string(string? actual, string? context = null)
+ throws Error {
+ if (actual != null) {
+ string a = actual;
+ if (a.length > 70) {
+ a = a[0:70] + "…";
+ }
+ print_assert("Expected: null, was: \"%s\"".printf(a), context);
+ assert_not_reached();
+ }
+}
+
public void assert_int(int expected, int actual, string? context = null)
throws Error {
if (expected != actual) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]