-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMetaSchemaTest.scala
33 lines (26 loc) · 1.08 KB
/
MetaSchemaTest.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package galliatest
package suites
import gallia._
import aptus._
// ===========================================================================
object MetaSchemaTest extends gallia.testing.Suite {
override def test() { TestDataO.Default01.noop(_.identity)
val input = cls("p".cls("f".string, "g".int), "h".boolean)
val expected = cls("p".cls("F".string, "g".int), "h".boolean)
// ---------------------------------------------------------------------------
input
.metaAObj
.transformSomeEntities("fields").matching("key" -> "p").using {
_.transformAllEntities("info" |> "union").using { // only one
_.transformEntity("valueType").using {
_.transformString("fields" |> "key").using {
case "f" => "F"; case x => x } } } }
._forceResult
.o
.pipe (Cls.fromObj)
.assert(_ == expected)
// ---------------------------------------------------------------------------
"metaschema: OK".p
}
}
// ===========================================================================