File: 02-legacy.t

package info (click to toggle)
libstatistics-r-perl 0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 236 kB
  • sloc: perl: 2,132; makefile: 2
file content (56 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! perl

use strict;
use warnings;
use Test::More;
use Statistics::R;

my $R;

my $file = "file.ps";

ok $R = Statistics::R->new();

ok $R->startR();

ok $R->restartR();

ok $R->send(qq`postscript("$file" , horizontal=FALSE , width=500 , height=500 , pointsize=1)`);

ok $R->send( q`plot(c(1, 5, 10), type = "l")` );

ok $R->send( qq`x = 123 \n print(x)` );

my $ret = $R->read();
ok $ret =~ /^\[\d+\]\s+123\s*$/;

ok $R->send( qq`x = 456 \n print(x)` );

$ret = $R->read();
ok $ret =~ /^\[\d+\]\s+456\s*$/;

ok $R->lock;

ok $R->unlock;

is $R->is_blocked, 0;

is $R->is_locked, 0;

ok $R->clean_up();

ok $R->Rbin() =~ /\S+/;

ok $R->stopR();

is $R->error(), '';

ok $R->start_shared();

ok $R->start_sharedR();

ok $R->stop();

unlink $file;

done_testing;