Stop mangling sql on the way out of the limit dialects
[dbsrgits/DBIx-Class.git] / t / sqlmaker / limit_dialects / generic_subq.t
index 8bd47b7..9e771a9 100644 (file)
@@ -122,4 +122,19 @@ is_deeply (
   'Correct columns selected with rows',
 );
 
+{
+  $rs = $schema->resultset('Artist')->search({}, {
+    columns => 'name',
+    offset => 1,
+    order_by => 'name',
+  });
+  local $rs->result_source->{name} = "weird \n newline/multi \t \t space containing \n table";
+
+  like (
+    ${$rs->as_query}->[0],
+    qr| weird \s \n \s newline/multi \s \t \s \t \s space \s containing \s \n \s table|x,
+    'Newlines/spaces preserved in final sql',
+  );
+}
+
 done_testing;