-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f300c98
commit 835b774
Showing
2 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
dataset/src/test/scala/frameless/WithColumnTypedTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package frameless | ||
|
||
import org.scalacheck.Prop | ||
import org.scalacheck.Prop._ | ||
|
||
class WithColumnTypedTest extends TypedDatasetSuite { | ||
test("append four columns") { | ||
def prop[A: TypedEncoder](value: A): Prop = { | ||
val d = TypedDataset.create(X1(value) :: Nil) | ||
val d1 = d.withColumnTyped[X2[A, A]](d('a)) | ||
val d2 = d1.withColumnTyped[X3[A, A, A]](d1('b)) | ||
val d3 = d2.withColumnTyped[X4[A, A, A, A]](d2('c)) | ||
val d4 = d3.withColumnTyped[X5[A, A, A, A, A]](d3('d)) | ||
|
||
X5(value, value, value, value, value) ?= d4.collect().run().head | ||
} | ||
|
||
check(prop[Int] _) | ||
check(prop[Long] _) | ||
check(prop[String] _) | ||
check(prop[SQLDate] _) | ||
check(prop[Option[X1[Boolean]]] _) | ||
} | ||
} |