]> git.donarmstrong.com Git - deb_pkgs/libstatistics-r-perl.git/blobdiff - t/06-get-set.t
Update upstream source from tag 'upstream/0.34'
[deb_pkgs/libstatistics-r-perl.git] / t / 06-get-set.t
index 202bee13c5d8227ee477b62f4c04d83c14804b20..dc698deecdb854a8232bdda93202abec2eb79f02 100644 (file)
@@ -5,9 +5,6 @@ use warnings;
 use Test::More;
 use Statistics::R;
 
-plan tests => 86;
-
-
 my ($R, $input, $output);
 
 
@@ -95,5 +92,32 @@ is $$output[1], 2;
 is $$output[2], 3;
 
 
+# Bug reported by Manuel A. Alonso Tarajano
+is $R->run(q`mydat = seq(1:4)`), '';
+ok $output = $R->get('mydat');
+is $$output[0], 1;
+is $$output[1], 2;
+is $$output[2], 3;
+is $$output[3], 4;
+
+
+# Strings containing quotes and escaped quotes
+$input = q{He said: "Let's go \"home\" now!\n"};
+ok $R->set('x', $input), 'string';
+ok $output = $R->get('x');
+is ref($output), '';
+is $output, q{He said: "Let's go \"home\" now!\n"};
+
+
+$input = q{He said: "Let's go \\\\\\\\\\\\\"home\\\\\\\\\\\\\" now!\n"};
+# because \ is a special char that needs to be escaped, this string really is:
+#          He said: "Let's go \\\\\\\"home\\\\\\\" now!\n
+ok $R->set('x', $input), 'string';
+ok $output = $R->get('x');
+is ref($output), '';
+is $output, q{He said: "Let's go \\\\\\\\\\\\\"home\\\\\\\\\\\\\" now!\n"};
+
+
 ok $R->stop();
 
+done_testing;