@@ -21,7 +21,7 @@ test_that("basic behavior works", {
2121 )
2222})
2323
24- test_that(" argument remove works" , {
24+ test_that(" argument ' remove' works" , {
2525 test_df <- tibble(
2626 year = 2009 : 2011 ,
2727 month = 10 : 12 ,
@@ -52,6 +52,28 @@ test_that("argument remove works", {
5252 )
5353})
5454
55+ test_that(" argument 'na.rm' works" , {
56+ test_df <- tibble(
57+ name = c(NA , " Jack" , " Thomas" ),
58+ middle = c(" T." , NA , " F." ),
59+ surname = c(NA , " Thompson" , " Jones" )
60+ )
61+ test_pl <- as_polars_lf(test_df )
62+
63+ expect_equal_lazy(
64+ unite(test_pl , col = " out" , name , middle , surname , sep = " -" ),
65+ unite(test_df , col = " out" , name , middle , surname , sep = " -" )
66+ )
67+ expect_equal_lazy(
68+ unite(test_pl , col = " out" , name , middle , surname , na.rm = FALSE ),
69+ unite(test_df , col = " out" , name , middle , surname , na.rm = FALSE )
70+ )
71+ expect_equal_lazy(
72+ unite(test_pl , col = " out" , name , middle , surname , na.rm = TRUE ),
73+ unite(test_df , col = " out" , name , middle , surname , na.rm = TRUE )
74+ )
75+ })
76+
5577test_that(" tidy selection works" , {
5678 test_df <- tibble(
5779 name = c(" John" , " Jack" , " Thomas" ),
@@ -61,20 +83,8 @@ test_that("tidy selection works", {
6183 test_pl <- as_polars_lf(test_df )
6284
6385 expect_equal_lazy(
64- unite(
65- test_pl ,
66- col = " full_name" ,
67- everything(),
68- sep = " " ,
69- na.rm = TRUE
70- ),
71- unite(
72- test_df ,
73- col = " full_name" ,
74- everything(),
75- sep = " " ,
76- na.rm = TRUE
77- )
86+ unite(test_pl , col = " full_name" , everything(), sep = " " ),
87+ unite(test_df , col = " full_name" , everything(), sep = " " )
7888 )
7989})
8090
0 commit comments