@@ -858,93 +858,3 @@ TEST(Output_simple, annotations_failure_1) {
858858 EXPECT_FALSE (result);
859859 EXPECT_ANNOTATION_COUNT (output, 0 );
860860}
861-
862- TEST (Output_simple, fail_stacktrace) {
863- const sourcemeta::core::JSON schema{sourcemeta::core::parse_json (R"JSON( {
864- "$schema": "https://json-schema.org/draft/2019-09/schema",
865- "properties": {
866- "foo": { "type": "object", "unevaluatedProperties": false },
867- "bar": {
868- "additionalProperties": {
869- "if": {
870- "type": "object",
871- "required": [ "$ref" ]
872- }
873- }
874- }
875- }
876- })JSON" )};
877-
878- const auto schema_template{sourcemeta::blaze::compile (
879- schema, sourcemeta::core::schema_official_walker,
880- sourcemeta::core::schema_official_resolver,
881- sourcemeta::blaze::default_schema_compiler)};
882-
883- const sourcemeta::core::JSON instance{sourcemeta::core::parse_json (R"JSON( {
884- "foo": { "/baz": 1 },
885- "bar": { "qux": {} }
886- })JSON" )};
887-
888- sourcemeta::blaze::SimpleOutput output{instance};
889- sourcemeta::blaze::Evaluator evaluator;
890- const auto result{
891- evaluator.validate (schema_template, instance, std::ref (output))};
892- EXPECT_FALSE (result);
893-
894- std::ostringstream message;
895- output.stacktrace (message);
896- EXPECT_EQ (
897- message.str (),
898- R"JSON( The object value was not expected to define the property "/baz"
899- at instance location "/foo/~1baz"
900- at evaluate path "/properties/foo/unevaluatedProperties"
901- The object value was not expected to define unevaluated properties
902- at instance location "/foo"
903- at evaluate path "/properties/foo/unevaluatedProperties"
904- )JSON" );
905- }
906-
907- TEST (Output_simple, fail_stacktrace_with_indentation) {
908- const sourcemeta::core::JSON schema{sourcemeta::core::parse_json (R"JSON( {
909- "$schema": "https://json-schema.org/draft/2019-09/schema",
910- "properties": {
911- "foo": { "type": "object", "unevaluatedProperties": false },
912- "bar": {
913- "additionalProperties": {
914- "if": {
915- "type": "object",
916- "required": [ "$ref" ]
917- }
918- }
919- }
920- }
921- })JSON" )};
922-
923- const auto schema_template{sourcemeta::blaze::compile (
924- schema, sourcemeta::core::schema_official_walker,
925- sourcemeta::core::schema_official_resolver,
926- sourcemeta::blaze::default_schema_compiler)};
927-
928- const sourcemeta::core::JSON instance{sourcemeta::core::parse_json (R"JSON( {
929- "foo": { "/baz": 1 },
930- "bar": { "qux": {} }
931- })JSON" )};
932-
933- sourcemeta::blaze::SimpleOutput output{instance};
934- sourcemeta::blaze::Evaluator evaluator;
935- const auto result{
936- evaluator.validate (schema_template, instance, std::ref (output))};
937- EXPECT_FALSE (result);
938-
939- std::ostringstream message;
940- output.stacktrace (message, " " );
941- EXPECT_EQ (
942- message.str (),
943- R"JSON( The object value was not expected to define the property "/baz"
944- at instance location "/foo/~1baz"
945- at evaluate path "/properties/foo/unevaluatedProperties"
946- The object value was not expected to define unevaluated properties
947- at instance location "/foo"
948- at evaluate path "/properties/foo/unevaluatedProperties"
949- )JSON" );
950- }
0 commit comments