@@ -4714,6 +4714,78 @@ TEST(Evaluator_draft4, enum_18) {
47144714 " one of the given declared values" );
47154715}
47164716
4717+ TEST (Evaluator_draft4, enum_19) {
4718+ const sourcemeta::core::JSON schema{sourcemeta::core::parse_json (R"JSON( {
4719+ "$schema": "http://json-schema.org/draft-04/schema#",
4720+ "properties": {
4721+ "foo": {
4722+ "type": "object",
4723+ "required": [ "bar" ],
4724+ "properties": {
4725+ "bar": {
4726+ "enum": [ "baz" ]
4727+ }
4728+ }
4729+ }
4730+ }
4731+ })JSON" )};
4732+
4733+ const sourcemeta::core::JSON instance{sourcemeta::core::parse_json (R"JSON( {
4734+ "foo": "bar"
4735+ })JSON" )};
4736+
4737+ EVALUATE_WITH_TRACE_FAST_FAILURE (schema, instance, 1 );
4738+
4739+ EVALUATE_TRACE_PRE (0 , AssertionDefinesStrict, " /properties/foo/required" ,
4740+ " #/properties/foo/required" , " /foo" );
4741+ EVALUATE_TRACE_POST_FAILURE (0 , AssertionDefinesStrict,
4742+ " /properties/foo/required" ,
4743+ " #/properties/foo/required" , " /foo" );
4744+
4745+ EVALUATE_TRACE_POST_DESCRIBE (instance, 0 ,
4746+ " The value was expected to be an object that "
4747+ " defines the property \" bar\" " );
4748+ }
4749+
4750+ TEST (Evaluator_draft4, enum_19_exhaustive) {
4751+ const sourcemeta::core::JSON schema{sourcemeta::core::parse_json (R"JSON( {
4752+ "$schema": "http://json-schema.org/draft-04/schema#",
4753+ "properties": {
4754+ "foo": {
4755+ "type": "object",
4756+ "required": [ "bar" ],
4757+ "properties": {
4758+ "bar": {
4759+ "enum": [ "baz" ]
4760+ }
4761+ }
4762+ }
4763+ }
4764+ })JSON" )};
4765+
4766+ const sourcemeta::core::JSON instance{sourcemeta::core::parse_json (R"JSON( {
4767+ "foo": "bar"
4768+ })JSON" )};
4769+
4770+ EVALUATE_WITH_TRACE_EXHAUSTIVE_FAILURE (schema, instance, 2 );
4771+
4772+ EVALUATE_TRACE_PRE (0 , LogicalAnd, " /properties" , " #/properties" , " " );
4773+ EVALUATE_TRACE_PRE (1 , AssertionDefinesStrict, " /properties/foo/required" ,
4774+ " #/properties/foo/required" , " /foo" );
4775+
4776+ EVALUATE_TRACE_POST_FAILURE (0 , AssertionDefinesStrict,
4777+ " /properties/foo/required" ,
4778+ " #/properties/foo/required" , " /foo" );
4779+ EVALUATE_TRACE_POST_FAILURE (1 , LogicalAnd, " /properties" , " #/properties" , " " );
4780+
4781+ EVALUATE_TRACE_POST_DESCRIBE (instance, 0 ,
4782+ " The value was expected to be an object that "
4783+ " defines the property \" bar\" " );
4784+ EVALUATE_TRACE_POST_DESCRIBE (instance, 1 ,
4785+ " The object value was expected to validate "
4786+ " against the single defined property subschema" );
4787+ }
4788+
47174789TEST (Evaluator_draft4, uniqueItems_1) {
47184790 const sourcemeta::core::JSON schema{sourcemeta::core::parse_json (R"JSON( {
47194791 "$schema": "http://json-schema.org/draft-04/schema#",
0 commit comments