summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristian Schneider2022-10-03 16:01:49 +0200
committerChristian Schneider2022-10-03 16:01:49 +0200
commit6d649237a4dae8cc6a1537902c1cfd8a3870243d (patch)
tree46c7cdc97f250a0a76fcd9a12562cd17010fcb04 /test
parent53db056c0fa24c1c8539a36002a3009f6a15bfa1 (diff)
downloaditools-6d649237a4dae8cc6a1537902c1cfd8a3870243d.tar.gz
itools-6d649237a4dae8cc6a1537902c1cfd8a3870243d.tar.bz2
itools-6d649237a4dae8cc6a1537902c1cfd8a3870243d.zip
Fix it_dbi being used with it::map/iterator_to_array
Diffstat (limited to 'test')
-rwxr-xr-xtest/it_dbi.t4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/it_dbi.t b/test/it_dbi.t
index b35c97d..2b5b0c5 100755
--- a/test/it_dbi.t
+++ b/test/it_dbi.t
@@ -444,6 +444,10 @@ $record->upsert(['ID' => 3, 'foo' => "c"]);
is($record->delete_untouched([ 'ID >' => 2 ]), [], 'delete_untouched with query');
is(allrecs(), '[{"ID":1,"foo":"A"},{"ID":2,"foo":"B"},{"ID":3,"foo":"c"}]', 'data after delete_untouched with query');
+# Test it::map with it_dbi (clone vs. reference issue)
+is(it::map('$v->foo', new it_dbi_test(['ID' => [1, 2, 3]])), [1 => 'A', 2 => 'B', 3 => 'c'], 'it_dbi with it::map');
+is(it::map('$v->foo', iterator_to_array(new it_dbi_test(['ID' => [1, 2, 3]]))), [1 => 'A', 2 => 'B', 3 => 'c'], 'it_dbi with iterator_to_array');
+
$record->upsert(['ID' => 3, 'foo' => "C"]);
is(it::sort($record->delete_untouched()), [1, 2], 'delete_untouched with query');
is(allrecs(), '[{"ID":3,"foo":"C"}]', 'data after delete_untouched with query');