add test for populate with literal sql mixed with binds, improve error messages
[dbsrgits/DBIx-Class.git] / t / 100populate.t
index ada70d9..9e7bc88 100644 (file)
@@ -114,9 +114,11 @@ is($link7->id, 7, 'Link 7 id');
 is($link7->url, undef, 'Link 7 url');
 is($link7->title, 'gtitle', 'Link 7 title');
 
-# test _execute_array_empty (insert_bulk with all literal sql)
 my $rs = $schema->resultset('Artist');
 $rs->delete;
+
+# test _execute_array_empty (insert_bulk with all literal sql)
+
 $rs->populate([
     (+{
         name => \"'DT'",
@@ -133,6 +135,26 @@ is((grep {
 
 $rs->delete;
 
+# test mixed binds with literal sql
+
+$rs->populate([
+    (+{
+        name => \"'DT'",
+        rank => 500,
+        charfield => \"'mtfnpy'",
+    }) x 5
+]);
+
+is((grep {
+  $_->name eq 'DT' &&
+  $_->rank == 500  &&
+  $_->charfield eq 'mtfnpy'
+} $rs->all), 5, 'populate with all literal SQL');
+
+$rs->delete;
+
+###
+
 throws_ok {
     $rs->populate([
         {