@@ -32,26 +32,35 @@ test_that("non-existant type hits error", {
3232})
3333
3434test_that(" config temp" , {
35+ orig.par <- par(no.readonly = TRUE )
3536 df <- data.frame (x = 1 : 10 , y = 1 : 10 , z = seq(2 ,20 ,2 ))
3637
3738 gsp <- gsplot(config.file = system.file(" extdata" , " lineScatter.yaml" , package = " gsplot" )) %> %
3839 lines(df $ x , df $ y , col = " red" , legend.name = " points" ) %> %
3940 legend()
4041 expect_true(gsp $ global $ config $ config.file )
42+ expect_equal(par(no.readonly = TRUE )$ lwd , orig.par $ lwd )
43+ gsp
4144 expect_equal(par(no.readonly = TRUE )$ lwd , 0.8 )
4245
4346 gspDef <- gsplot() %> %
4447 lines(df $ x , df $ y , col = " red" , legend.name = " points" )
4548 expect_false(gspDef $ global $ config $ config.file )
46- expect_equal(par(no.readonly = TRUE )$ lwd , 1 )
49+ expect_equal(par(no.readonly = TRUE )$ lwd , orig.par $ lwd )
4750
4851 loadConfig(system.file(" extdata" , " lineScatter.yaml" , package = " gsplot" ))
52+ expect_equal(par(no.readonly = TRUE )$ lwd , orig.par $ lwd )
53+
4954 gsp <- gsplot() %> %
5055 lines(df $ x , df $ y , col = " red" , legend.name = " points" )
56+ expect_equal(par(no.readonly = TRUE )$ lwd , orig.par $ lwd )
5157 expect_false(gsp $ global $ config $ config.file )
5258 expect_equal(gsp $ side.1 $ axis $ lwd , 0.8 )
59+ gsp
60+ expect_equal(par(no.readonly = TRUE )$ lwd , 0.8 )
5361
5462 loadConfig()
63+ expect_equal(par(no.readonly = TRUE )$ lwd , orig.par $ lwd )
5564 gspDef2 <- gsplot() %> %
5665 lines(df $ x , df $ y , col = " red" , legend.name = " points" )
5766 expect_false(gspDef2 $ global $ config $ config.file )
0 commit comments