[geary/wip/misc-cleanup: 2/4] Add some minor unit tests
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/misc-cleanup: 2/4] Add some minor unit tests
- Date: Tue, 6 Aug 2019 11:42:50 +0000 (UTC)
commit 329d0380e9f4be9f2ce15078966a1fed5188d91b
Author: Michael Gratton <mike vee net>
Date: Tue Aug 6 21:37:39 2019 +1000
Add some minor unit tests
test/engine/util-string-test.vala | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/test/engine/util-string-test.vala b/test/engine/util-string-test.vala
index 29ecd4b7..12337e45 100644
--- a/test/engine/util-string-test.vala
+++ b/test/engine/util-string-test.vala
@@ -11,6 +11,7 @@ class Geary.String.Test : TestCase {
base("Geary.String.Test");
add_test("test_whitespace", test_whitespace);
add_test("test_nonprinting", test_nonprinting);
+ add_test("test_contains_any_char", test_contains_any_char);
}
public void test_whitespace() throws Error {
@@ -44,4 +45,12 @@ class Geary.String.Test : TestCase {
assert(reduce_whitespace("test\n") == "test");
assert(reduce_whitespace("test\ntest") == "test test");
}
+
+ public void test_contains_any_char() throws GLib.Error {
+ assert(!contains_any_char("test", new unichar[]{ '@' }));
+ assert(contains_any_char("@test", new unichar[]{ '@' }));
+ assert(contains_any_char("te@st", new unichar[]{ '@' }));
+ assert(contains_any_char("test@", new unichar[]{ '@' }));
+ }
+
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]