X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=t%2F07-robust.t;fp=t%2F07-robust.t;h=fb1726578bfb0462adcc3e0e8df38d2392c78c3d;hb=5e71068076c23e49ee5655b94ea2c4b403790cbf;hp=51b6f85ca0486b36db1c4e0318c1149d002dae0e;hpb=9d6b5f35bbae817f76a5099702e13836e5957d80;p=deb_pkgs%2Flibstatistics-r-perl.git diff --git a/t/07-robust.t b/t/07-robust.t index 51b6f85..fb17265 100644 --- a/t/07-robust.t +++ b/t/07-robust.t @@ -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;