15 ok $R = Statistics::R->new();
17 ok $R->bin() =~ /\S+/, 'Binary';
20 is $R->run( ), $expected;
23 is $R->run( qq`postscript("$file" , horizontal=FALSE , width=500 , height=500 , pointsize=1)`), $expected, 'Basic';
26 is $R->run( q`plot(c(1, 5, 10), type = "l")` ), $expected;
31 is $R->run( q`dev.off()` ), $expected; # RT bug #66190
33 ok -e $file; # RT bug #70307
40 is $R->run( q`for (j in 1:3) { cat("loop iteration "); cat(j); cat("\n") }` ), $expected;
42 $expected = 'Some innocuous message on stderr';
43 is $R->run( q`write("Some innocuous message on stderr", stderr())` ), $expected, 'IO';
45 $expected = 'Some innocuous message on stdout';
46 is $R->run( q`write("Some innocuous message on stdout", stdout())` ), $expected;
48 $expected = '[1] 123';
49 is $R->run( qq`x <- 123 \n print(x)` ), $expected, 'Multi-line commands';
52 my $cmd1 = 'x <- 456 ; write.table(x, file="", row.names=FALSE, col.names=FALSE)';
53 is $R->run( $cmd1 ), $expected; # RT bug #70314
61 $expected = '[1] "ok"';
62 is $R->run( $cmd2 ), $expected, 'Heredoc commands';
67 is $R->run( $cmd1, $cmd2 ), $expected, 'Multiple commands';
70 'Some innocuous message on stderr
74 Some innocuous message on stdout
79 is $R->run_from_file( './t/data/script.R' ), $expected, 'Commands from file';