[perl-Glib-Object-Introspection] Add more basic tests



commit d48b2010edaab83b0294ed8ef1744c61c33c1df1
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sun Jun 5 13:40:24 2011 +0200

    Add more basic tests

 t/00-basic-types.t |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/t/00-basic-types.t b/t/00-basic-types.t
index 478b56b..e5a35d3 100644
--- a/t/00-basic-types.t
+++ b/t/00-basic-types.t
@@ -8,7 +8,7 @@ use warnings;
 use utf8;
 use POSIX qw(FLT_MIN FLT_MAX DBL_MIN DBL_MAX);
 
-plan tests => 31;
+plan tests => 34;
 
 ok (test_boolean (1));
 ok (!test_boolean (0));
@@ -27,6 +27,9 @@ delta_ok (test_double (DBL_MAX), DBL_MAX);
 
 is (test_unichar ('â?µ'), 'â?µ');
 
+my $time = time ();
+is (test_timet ($time), $time);
+
 is (test_gtype ('Glib::Object'), 'Glib::Object');
 TODO: {
   local $TODO = 'Is that how we want to handle unregistered GTypes?';
@@ -35,24 +38,28 @@ TODO: {
 }
 is (test_gtype ('Inexistant'), undef);
 
-ok (defined test_utf8_const_return ());
-ok (defined test_utf8_nonconst_return ());
+my $expected_const_string = 'const â?¥ utf8';
+my $expected_nonconst_string = 'nonconst â?¥ utf8';
+is (test_utf8_const_return (), $expected_const_string);
+is (test_utf8_nonconst_return (), $expected_nonconst_string);
 test_utf8_const_in (test_utf8_const_return ());
-ok (defined test_utf8_out ());
+is (test_utf8_out (), $expected_nonconst_string);
 is (test_utf8_inout (test_utf8_const_return ()), test_utf8_nonconst_return ());
 test_utf8_null_in (undef);
 is (test_utf8_null_out (), undef);
 
 my $filenames = test_filename_return ();
 is (scalar @$filenames, 2);
+is ($filenames->[0], 'åäö');
+is ($filenames->[1], '/etc/fstab');
 
 is (test_int_out_utf8 ('Παν�'), 4);
 my ($one, $two) = test_multi_double_args (my $pi = 3.1415);
 delta_ok ($one, 2*$pi);
 delta_ok ($two, 3*$pi);
 ($one, $two) = test_utf8_out_out ();
-ok (defined $one);
-ok (defined $two);
+is ($one, 'first');
+is ($two, 'second');
 ($one, $two) = test_utf8_out_nonconst_return ();
-ok (defined $one);
-ok (defined $two);
+is ($one, 'first');
+is ($two, 'second');



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]