Skip to content

Commit aef5274

Browse files
committed
Add missing tests for Schema.doc and Schema.examples
1 parent b6f72ce commit aef5274

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

schema/shared/src/test/scala/zio/blocks/schema/SchemaSpec.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ object SchemaSpec extends ZIOSpecDefault {
4141
)
4242
assert(Schema(long1).doc)(equalTo(Doc("Long (positive)")))
4343
},
44+
test("updates primitive documentation") {
45+
assert(Schema[Int].doc("Int (updated)").doc)(equalTo(Doc("Int (updated)")))
46+
},
4447
test("has access to primitive examples") {
4548
val long1 = Primitive(
4649
primitiveType = PrimitiveType.Long(Validation.Numeric.Positive),
@@ -50,6 +53,9 @@ object SchemaSpec extends ZIOSpecDefault {
5053
modifiers = Nil
5154
)
5255
assert(Schema(long1).examples)(equalTo(List(1L, 2L, 3L)))
56+
},
57+
test("updates primitive examples") {
58+
assert(Schema[Int].examples(1, 2, 3).examples)(equalTo(List(1, 2, 3)))
5359
}
5460
),
5561
suite("Reflect.Record")(

0 commit comments

Comments
 (0)