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