The R Project SVN R

Rev

Rev 81944 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20124 ripley 1
 
85382 maechler 2
R Under development (unstable) (2023-10-20 r85375) -- "Unsuffered Consequences"
3
Copyright (C) 2023 The R Foundation for Statistical Computing
4
Platform: x86_64-pc-linux-gnu
20124 ripley 5
 
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
7
You are welcome to redistribute it under certain conditions.
39826 maechler 8
Type 'license()' or 'licence()' for distribution details.
20124 ripley 9
 
10
R is a collaborative project with many contributors.
39826 maechler 11
Type 'contributors()' for more information and
12
'citation()' on how to cite R or R packages in publications.
20124 ripley 13
 
39826 maechler 14
Type 'demo()' for some demos, 'help()' for on-line help, or
15
'help.start()' for an HTML browser interface to help.
16
Type 'q()' to quit R.
20124 ripley 17
 
18
> #### STRICT test suite in the spirit of no-segfaults,
19
> #### but with explicit statements.
20
> 
85382 maechler 21
> tools::assertError(options(catch.script.errors = NA)) # TRUE or FALSE
22
> options(catch.script.errors = TRUE)
23
> stop("test of 'options(catch.script.errors = TRUE)'")
24
Error: test of 'options(catch.script.errors = TRUE)'
20124 ripley 25
> 
26
> if(FALSE) {
27
+ ## these ought to work on machines with enough memory
28
+ ## These segfaulted in 1.3.x ,  give "could not allocate" errors now
29
+   integer(2^30+1)
30
+    double(2^30+1)
31
+   complex(2^30+1)
32
+ character(2^30+1)
33
+ vector("list", 2^30+2)
34
+ }
35
> 
42973 maechler 36
> ## bad infinite recursion / on.exit / ... interactions
70362 luke 37
> ##   catch the error to permit different error messages emitted
38
> ##   (handling of infinite recursion is different in the AST interpreter
39
> ##   and the byte-code interpreter)
40
> 
69945 luke 41
> bar <- function() 1+1
42
> foo <- function() { on.exit(bar()); foo() }
70362 luke 43
> tryCatch(foo(), error=function(x) TRUE) # now simple "infinite recursion"
44
[1] TRUE
42973 maechler 45
>