File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -792,6 +792,27 @@ test_that("scale updating mechanism works", {
792
792
expect_equal(l $ .label , as.character(c(3 , 5 )), ignore_attr = " pos" )
793
793
})
794
794
795
+ test_that(" scale updateable params is consistent with constructors" , {
796
+
797
+ # Note: 'trans' is deprecated in favour of 'transform'
798
+ constr_params <- function (fun ) setdiff(fn_fmls_names(fun ), " trans" )
799
+
800
+ expect_setequal(
801
+ ScaleContinuous $ updatable_params ,
802
+ constr_params(continuous_scale )
803
+ )
804
+
805
+ expect_setequal(
806
+ ScaleDiscrete $ updatable_params ,
807
+ constr_params(discrete_scale )
808
+ )
809
+
810
+ expect_setequal(
811
+ ScaleBinned $ updatable_params ,
812
+ constr_params(binned_scale )
813
+ )
814
+ })
815
+
795
816
test_that(" discrete scales can map to 2D structures" , {
796
817
797
818
p <- ggplot(mtcars , aes(disp , mpg , colour = factor (cyl ))) +
You can’t perform that action at this time.
0 commit comments