|
31 | 31 | @test Tables.columnnames(n) == (:e, :c, :b, :a)
|
32 | 32 | tₒ = revert(T, n, c)
|
33 | 33 | @test t == tₒ
|
| 34 | + |
| 35 | + # selection with tuples |
| 36 | + T = Select((:e, :c, :b, :a)) |
| 37 | + n, c = apply(T, t) |
| 38 | + @test Tables.columnnames(n) == (:e, :c, :b, :a) |
| 39 | + tₒ = revert(T, n, c) |
| 40 | + @test t == tₒ |
| 41 | + |
| 42 | + # selection with vectors |
| 43 | + T = Select([:e, :c, :b, :a]) |
| 44 | + n, c = apply(T, t) |
| 45 | + @test Tables.columnnames(n) == (:e, :c, :b, :a) |
| 46 | + tₒ = revert(T, n, c) |
| 47 | + @test t == tₒ |
| 48 | + |
| 49 | + # selection with strings |
| 50 | + T = Select("d", "c", "b") |
| 51 | + n, c = apply(T, t) |
| 52 | + @test Tables.columnnames(n) == (:d, :c, :b) |
| 53 | + tₒ = revert(T, n, c) |
| 54 | + @test t == tₒ |
| 55 | + |
| 56 | + # selection with single column |
| 57 | + @test (Select(:a) == Select("a") == |
| 58 | + Select((:a,)) == Select(("a",)) == |
| 59 | + Select([:a]) == Select(["a"])) |
34 | 60 | end
|
35 | 61 |
|
36 | 62 | @testset "Reject" begin
|
|
65 | 91 | @test Tables.columnnames(n) == (:d, :f)
|
66 | 92 | tₒ = revert(T, n, c)
|
67 | 93 | @test t == tₒ
|
| 94 | + |
| 95 | + # rejection with tuples |
| 96 | + T = Reject((:e, :c, :b, :a)) |
| 97 | + n, c = apply(T, t) |
| 98 | + @test Tables.columnnames(n) == (:d, :f) |
| 99 | + tₒ = revert(T, n, c) |
| 100 | + @test t == tₒ |
| 101 | + |
| 102 | + # rejection with vectors |
| 103 | + T = Reject([:e, :c, :b, :a]) |
| 104 | + n, c = apply(T, t) |
| 105 | + @test Tables.columnnames(n) == (:d, :f) |
| 106 | + tₒ = revert(T, n, c) |
| 107 | + @test t == tₒ |
| 108 | + |
| 109 | + # rejection with strings |
| 110 | + T = Reject("d", "c", "b") |
| 111 | + n, c = apply(T, t) |
| 112 | + @test Tables.columnnames(n) == (:a, :e, :f) |
| 113 | + tₒ = revert(T, n, c) |
| 114 | + @test t == tₒ |
| 115 | + |
| 116 | + # rejection with single column |
| 117 | + @test (Reject(:a) == Reject("a") == |
| 118 | + Reject((:a,)) == Reject(("a",)) == |
| 119 | + Reject([:a]) == Reject(["a"])) |
68 | 120 | end
|
69 | 121 |
|
70 | 122 | @testset "Identity" begin
|
|
0 commit comments