[gspell] testsuite: test _gspell_utils_is_number()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gspell] testsuite: test _gspell_utils_is_number()
- Date: Wed, 9 Mar 2016 10:16:47 +0000 (UTC)
commit 8fc26a4d5ca765234ccd01807c827be827b9b80f
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Mar 9 11:16:06 2016 +0100
testsuite: test _gspell_utils_is_number()
testsuite/test-utils.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/testsuite/test-utils.c b/testsuite/test-utils.c
index 59fdefe..ed189bc 100644
--- a/testsuite/test-utils.c
+++ b/testsuite/test-utils.c
@@ -20,6 +20,27 @@
#include "gspell/gspell-utils.h"
static void
+test_is_number (void)
+{
+ gboolean is_number;
+
+ is_number = _gspell_utils_is_number ("123", -1);
+ g_assert (is_number);
+
+ is_number = _gspell_utils_is_number ("123", 3);
+ g_assert (is_number);
+
+ is_number = _gspell_utils_is_number ("123a4", 3);
+ g_assert (is_number);
+
+ is_number = _gspell_utils_is_number ("123a4", -1);
+ g_assert (!is_number);
+
+ is_number = _gspell_utils_is_number ("h4ck1ng", -1);
+ g_assert (!is_number);
+}
+
+static void
test_str_replace (void)
{
gchar *result;
@@ -86,6 +107,7 @@ main (gint argc,
{
gtk_test_init (&argc, &argv);
+ g_test_add_func ("/utils/is_number", test_is_number);
g_test_add_func ("/utils/str_replace", test_str_replace);
g_test_add_func ("/utils/str_to_ascii_apostrophe", test_str_to_ascii_apostrophe);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]