[perl-Gtk3] Add two more tests for Gtk3::TextBuffer
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk3] Add two more tests for Gtk3::TextBuffer
- Date: Wed, 25 Sep 2013 19:38:59 +0000 (UTC)
commit 7351cd36624714c6b109b076f9c503afdd47dab7
Author: Zach Morgan <zpmorgan gmail com>
Date: Tue Sep 3 21:29:34 2013 -0400
Add two more tests for Gtk3::TextBuffer
Namely for:
* textiter->forward_find_char
* textiter->backward_find_char
These both involve callbacks with GI_TYPE_TAG_UNICHAR, support for which was
added to Glib::Object::Introspection recently.
dist.ini | 2 +-
t/zz-GtkTextBuffer.t | 13 ++++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/dist.ini b/dist.ini
index 3357503..4d7608c 100644
--- a/dist.ini
+++ b/dist.ini
@@ -18,7 +18,7 @@ copyright_year = 2013
Carp = 0 ; core
Exporter = 0 ; core
Cairo::GObject = 1.000
-Glib::Object::Introspection = 0.015
+Glib::Object::Introspection = 0.015 ; FIXME: 0.016
[NextRelease]
filename = NEWS
diff --git a/t/zz-GtkTextBuffer.t b/t/zz-GtkTextBuffer.t
index 8f8f640..70d4784 100644
--- a/t/zz-GtkTextBuffer.t
+++ b/t/zz-GtkTextBuffer.t
@@ -9,7 +9,7 @@ use warnings;
use utf8;
use Glib qw/TRUE FALSE/;
-plan tests => 40;
+plan tests => 44;
my $table = Gtk3::TextTagTable -> new();
@@ -158,3 +158,14 @@ $buffer -> end_user_action();
my $mark = Gtk3::TextMark -> new('bla', TRUE);
$buffer -> add_mark($mark, $end->());
}
+
+{
+ my $buf = Gtk3::TextBuffer -> new();
+ $buf -> set_text('v年x最y');
+ my ($s,$e) = $buf -> get_bounds();
+ ok($s -> forward_find_char(sub{shift eq '年'}));
+ is($s -> get_char, '年');
+ ok(not $e -> backward_find_char(sub{shift eq '%'}, undef, $s));
+ is($e -> get_char, '年');
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]