| 1 |
## This test asserts that two R connections are identified as different, |
| 2 |
## although they share the same connection index. This helps to work |
| 3 |
## around a bug in R [1] |
| 4 |
## [1] https://github.com/HenrikBengtsson/Wishlist-for-R/issues/81 |
| 5 |
|
| 6 |
message("all.equal() for connection ...") |
| 7 |
con1 <- rawConnection(raw()) |
| 8 |
close(con1) |
| 9 |
|
| 10 |
con2 <- rawConnection(raw()) |
| 11 |
close(con2) |
| 12 |
|
| 13 |
con3 <- rawConnection(raw()) |
| 14 |
stopifnot(isTRUE(all.equal(con3, con3))) |
| 15 |
close(con3) |
| 16 |
|
| 17 |
stopifnot(!isTRUE(all.equal(con1, con2))) |
| 18 |
message("all.equal() for connection ... done") |