[gimp-perl] Test Gimp::Data.



commit ddf2e8bd7d457bfa046dd96c623df4f5dff649a6
Author: Ed J <edj src gnome org>
Date:   Mon May 26 06:27:58 2014 +0100

    Test Gimp::Data.

 t/data.t |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/t/data.t b/t/data.t
new file mode 100644
index 0000000..bf46d53
--- /dev/null
+++ b/t/data.t
@@ -0,0 +1,33 @@
+use strict;
+use Test::More;
+our ($dir, $DEBUG);
+BEGIN {
+#  $Gimp::verbose = 3;
+  $DEBUG = 0;
+  require 't/gimpsetup.pl';
+}
+use Gimp qw(:DEFAULT net_init=spawn/);
+use Gimp::Data;
+
+my @DATA = (
+  [ 'testing/newkey1', 'data' ],
+  [ 'testing/newkey2', [ 8, 'stuff', 1 ] ],
+  [ 'testing/newkey3', +{ k1 => 9, k2 => 'other' } ],
+);
+
+for my $pair (@DATA) {
+  ok(!$Gimp::Data{$pair->[0]}, "start empty $pair->[0]");
+  $Gimp::Data{$pair->[0]} = $pair->[1];
+  is_deeply($Gimp::Data{$pair->[0]}, $pair->[1], "stored $pair->[0]");
+}
+
+Gimp::Net::gimp_end;
+Gimp->import(qw(net_init=spawn/));
+
+for my $pair (@DATA) {
+  is_deeply([ $Gimp::Data{$pair->[0]} ], [ $pair->[1] ], "still $pair->[0]");
+}
+
+Gimp::Net::gimp_end;
+
+done_testing;


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