]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - t/15-misc-xs.t
Fix discrepancy between add('list',1) and add({list=>1},1) in favor of the latter
[perl/modules/Sub-Nary.git] / t / 15-misc-xs.t
index bd6baacc1d70327a48de9dd925ef61b9de0a9f4a..80de3c5a02b9c198d7436964eecb4addf4ec3f1b 100644 (file)
@@ -23,11 +23,11 @@ is_deeply(scale(1, {}), { 0 => 1 }, 'scale const, empty-ref');
 
 *add = *Sub::Nary::add{CODE};
 
-is_deeply(add('list'),             { list => 1 }, 'add list');
-is_deeply(add(1, 'list'),          { list => 1 }, 'add const, list');
-is_deeply(add({ }, 'list'),        { list => 1 }, 'add empty-ref, list');
-is_deeply(add({ 1 => 1 }, 'list'), { list => 1 }, 'add ref, list');
-is_deeply(add({ 1 => 1 }, 1),      { 1 => 2 }, 'add ref, prev-const');
+is_deeply(add('list'),             { list => 1 },         'add list');
+is_deeply(add(1, 'list'),          { 1 => 1, list => 1 }, 'add const, list');
+is_deeply(add({ }, 'list'),        { list => 1 },        'add empty-ref, list');
+is_deeply(add({ 1 => 1 }, 'list'), { 1 => 1, list => 1 }, 'add ref, list');
+is_deeply(add({ 1 => 1 }, 1),      { 1 => 2 },           'add ref, prev-const');
 
 *cumulate = *Sub::Nary::cumulate{CODE};