]> git.donarmstrong.com Git - deb_pkgs/libstatistics-r-perl.git/blob - t/02-legacy.t
Import Upstream version 0.24
[deb_pkgs/libstatistics-r-perl.git] / t / 02-legacy.t
1 #! perl
2
3 use strict;
4 use warnings;
5 use Test::More;
6 use Statistics::R;
7
8 plan tests => 20;
9
10
11 my $R;
12
13 my $file = "file.ps";
14
15 ok $R = Statistics::R->new();
16
17 ok $R->startR();
18
19 ok $R->restartR();
20
21 ok $R->send(qq`postscript("$file" , horizontal=FALSE , width=500 , height=500 , pointsize=1)`);
22
23 ok $R->send( q`plot(c(1, 5, 10), type = "l")` );
24
25 ok $R->send( qq`x = 123 \n print(x)` );
26
27 my $ret = $R->read();
28 ok $ret =~ /^\[\d+\]\s+123\s*$/;
29
30 ok $R->send( qq`x = 456 \n print(x)` );
31
32 $ret = $R->read();
33 ok $ret =~ /^\[\d+\]\s+456\s*$/;
34
35 ok $R->lock;
36
37 ok $R->unlock;
38
39 is $R->is_blocked, 0;
40
41 is $R->is_locked, 0;
42
43 ok $R->clean_up();
44
45 ok $R->Rbin() =~ /\S+/;
46
47 ok $R->stopR();
48
49 is $R->error(), '';
50
51 ok $R->start_shared();
52
53 ok $R->start_sharedR();
54
55 ok $R->stop();
56
57 unlink $file;