Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
pablf committed Aug 2, 2024
1 parent 7732b7b commit 5eb5739
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object DynamicValueSpec extends ZIOSpecDefault {
},
test("round-trips Eithers") {
check(SchemaGen.anyEitherAndValue) {
case (schema: Schema[Either[_, _]], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
case (schema: Schema[Either[?, ?]], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
}
},
test("round-trips Tuples") {
Expand All @@ -35,38 +35,38 @@ object DynamicValueSpec extends ZIOSpecDefault {
},
test("round-trips Optionals") {
check(SchemaGen.anyOptionalAndValue) {
case (schema: Schema[Option[_]], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
case (schema: Schema[Option[?]], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
}
},
test("round-trips Transform") {
check(SchemaGen.anyTransformAndValue) {
case (schema: Schema[_], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
case (schema: Schema[?], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
}
},
test("round-trips CaseClass") {
check(SchemaGen.anyCaseClassAndValue) {
case (schema: Schema[_], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
case (schema: Schema[?], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
}
},
test("round-trips Enum") {
check(SchemaGen.anyEnumAndValue) {
case (schema: Schema[_], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
case (schema: Schema[?], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
}
},
test("round-trips any un-nested schema") {
check(SchemaGen.anyLeafAndValue) {
case (schema: Schema[_], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
case (schema: Schema[?], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
}
},
test("round-trips any nested schema") {
check(SchemaGen.anyTree(1).flatMap(s => DynamicValueGen.anyDynamicValueOfSchema(s).map(s -> _))) {
case (schema, dynamic) =>
assert(schema.asInstanceOf[Schema[_]].fromDynamic(dynamic))(isRight)
assert(schema.asInstanceOf[Schema[?]].fromDynamic(dynamic))(isRight)
}
},
test("round-trips recursive data types") {
check(SchemaGen.anyRecursiveTypeAndValue) {
case (schema: Schema[_], a) =>
case (schema: Schema[?], a) =>
assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
}
},
Expand All @@ -77,12 +77,12 @@ object DynamicValueSpec extends ZIOSpecDefault {
},
test("round-trips set") {
check(SchemaGen.anySetAndValue) {
case (schema: Schema[_], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
case (schema: Schema[?], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
}
},
test("round-trips map") {
check(SchemaGen.anyMapAndValue) {
case (schema: Schema[Map[_, _]], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
case (schema: Schema[Map[?, ?]], a) => assert(schema.fromDynamic(schema.toDynamic(a)))(isRight(equalTo(a)))
}
}
),
Expand Down

0 comments on commit 5eb5739

Please sign in to comment.