|
21 | 21 | )
|
22 | 22 | test_long1 = @pivot_longer(test_df, -label)
|
23 | 23 | test_long2 = @pivot_longer(test_df, name:num)
|
24 |
| - |
| 24 | + |
25 | 25 | true_long3 = DataFrame(
|
26 | 26 | name = ["A","B","A","B"],
|
27 | 27 | num = [1,2,3,4],
|
|
37 | 37 | value = [1,1,2,2,1,2,3,4],
|
38 | 38 | )
|
39 | 39 | test_long5 = @pivot_longer(test_df, [label,num])
|
40 |
| - |
| 40 | + |
41 | 41 | true_long6 = DataFrame(
|
42 | 42 | label = [1,1,2,2],
|
43 | 43 | num = [1,2,3,4],
|
44 | 44 | variable = ["name","name","name","name"],
|
45 | 45 | value = ["A","B","A","B"],
|
46 | 46 | )
|
47 | 47 | test_long6 = @pivot_longer(test_df, -[label,num])
|
48 |
| - |
| 48 | + |
49 | 49 | true_long7 = DataFrame(
|
50 | 50 | variable = ["label","label","label","label","name","name","name","name","num","num","num","num"],
|
51 | 51 | value = [1,1,2,2,"A","B","A","B",1,2,3,4],
|
52 | 52 | )
|
53 | 53 | test_long7 = @pivot_longer(test_df, :)
|
54 | 54 | test_long8 = @pivot_longer(test_df)
|
| 55 | + test_long9 = @pivot_longer(test_df, everything()) |
55 | 56 |
|
56 | 57 | @test all(Array(true_long1 .== test_long1))
|
57 | 58 | @test all(Array(true_long1 .== test_long2))
|
|
61 | 62 | @test all(Array(true_long6 .== test_long6))
|
62 | 63 | @test all(Array(true_long7 .== test_long7))
|
63 | 64 | @test all(Array(true_long7 .== test_long8))
|
| 65 | + @test all(Array(true_long7 .== test_long9)) |
64 | 66 | end
|
65 | 67 | end
|
0 commit comments