Commits

shl...@cec68495-dca5-4e2b-845c-11fdaaa4f967  committed c0acf61

Added a test for references.

  • Participants
  • Parent commits 06e5be7

Comments (0)

Files changed (1)

File perl5/ext-embed-internals/docbook/examples/incremental-examples-1/XSTest/t/11-lookup-hash-constant.t

 use strict;
 use warnings;
 
-use Test::More tests => 3;
+use Test::More tests => 4;
 
 use XSTest;
 
     is ($value, "Hello", "Lookup is OK with other value.")
 }
 
-
 {
     my $value = XSTest::lookup_mystring_in_hash(
         { 'author' => "Jane", year => 1950, }
     ok (!defined($value), "Return undef if value not found.")
 }
 
+{
+    my %hash = ('mystring' => ["56", "78"], 'author' => "Jane");
+    my $value = XSTest::lookup_mystring_in_hash(
+        \%hash,
+    );
+
+    push @$value, "MyVal";
+
+    # TEST
+    is_deeply (
+        \%hash, 
+        {
+            mystring => [qw(56 78 MyVal)],
+            author => "Jane",
+        },
+        "References are handled correctly."
+    );
+}