]> git.donarmstrong.com Git - deb_pkgs/libstatistics-r-perl.git/blobdiff - t/07-robust.t
Update upstream source from tag 'upstream/0.34'
[deb_pkgs/libstatistics-r-perl.git] / t / 07-robust.t
index 51b6f85ca0486b36db1c4e0318c1149d002dae0e..fb1726578bfb0462adcc3e0e8df38d2392c78c3d 100644 (file)
@@ -5,21 +5,31 @@ use warnings;
 use Test::More;
 use Statistics::R;
 
-plan tests => 10003;
-
-
-# Test that the IOs are well-oiled. In Statistics::R version 0.20, a slight
-# imprecision in the regular expression to parse the output stream caused a
-# problem was apparent only once every few thousands times
 
 my ($R, $input);
 
 ok $R = Statistics::R->new();
 
-ok $R->set('x', $input);
 
-for my $i (1 .. 10000) {
-   is($R->get('x'), undef);
+# Test that we can recover from a R quit() command
+is $R->run(q`quit()`), '', 'Handle quit()';
+is $R->run(q`cat("foo")`), 'foo';
+
+
+# Test that large arrays can be read
+ok $R->set('y', [1 .. 100_000]), 'Large arrays';
+is $R->get('y')->[-1], 100_000;
+
+
+# Test that the IOs are well-oiled. In Statistics::R version 0.20, a slight
+# imprecision in the regular expression to parse the output stream caused a
+# problem that was apparent only once every few thousands times
+ok $R->set('z', $input), 'Smooth IO';
+for my $i (1 .. 10_000) {
+   is $R->get('z'), undef;
 }
 
 ok $R->stop();
+
+
+done_testing;