@@ -2417,6 +2417,92 @@ TEST(AlterSchema_lint_2019_09, incoherent_min_max_contains_9) {
24172417 true );
24182418}
24192419
2420+ TEST (AlterSchema_lint_2019_09, incoherent_exclusive_limits_1) {
2421+ const sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
2422+ "$schema": "https://json-schema.org/draft/2019-09/schema",
2423+ "title": "Test",
2424+ "description": "A test schema",
2425+ "examples": [ "foo" ],
2426+ "exclusiveMinimum": 1,
2427+ "exclusiveMaximum": 5
2428+ })JSON" );
2429+
2430+ LINT_WITHOUT_FIX (document, result, traces);
2431+
2432+ EXPECT_TRUE (result.first );
2433+ EXPECT_EQ (traces.size (), 0 );
2434+ }
2435+
2436+ TEST (AlterSchema_lint_2019_09, incoherent_exclusive_limits_2) {
2437+ const sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
2438+ "$schema": "https://json-schema.org/draft/2019-09/schema",
2439+ "title": "Test",
2440+ "description": "A test schema",
2441+ "examples": [ "foo" ],
2442+ "exclusiveMinimum": 1
2443+ })JSON" );
2444+
2445+ LINT_WITHOUT_FIX (document, result, traces);
2446+
2447+ EXPECT_TRUE (result.first );
2448+ EXPECT_EQ (traces.size (), 0 );
2449+ }
2450+
2451+ TEST (AlterSchema_lint_2019_09, incoherent_exclusive_limits_3) {
2452+ const sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
2453+ "$schema": "https://json-schema.org/draft/2019-09/schema",
2454+ "title": "Test",
2455+ "description": "A test schema",
2456+ "examples": [ "foo" ],
2457+ "exclusiveMinimum": 3,
2458+ "exclusiveMaximum": 3
2459+ })JSON" );
2460+
2461+ LINT_WITHOUT_FIX (document, result, traces);
2462+
2463+ EXPECT_FALSE (result.first );
2464+ EXPECT_EQ (traces.size (), 1 );
2465+ EXPECT_LINT_TRACE (traces, 0 , " " , " incoherent_exclusive_limits" ,
2466+ " `exclusiveMinimum` greater than or equal to "
2467+ " `exclusiveMaximum` makes the schema unsatisfiable" ,
2468+ true );
2469+ }
2470+
2471+ TEST (AlterSchema_lint_2019_09, incoherent_exclusive_limits_4) {
2472+ const sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
2473+ "$schema": "https://json-schema.org/draft/2019-09/schema",
2474+ "title": "Test",
2475+ "description": "A test schema",
2476+ "examples": [ "foo" ],
2477+ "exclusiveMinimum": 5,
2478+ "exclusiveMaximum": 2
2479+ })JSON" );
2480+
2481+ LINT_WITHOUT_FIX (document, result, traces);
2482+
2483+ EXPECT_FALSE (result.first );
2484+ EXPECT_EQ (traces.size (), 1 );
2485+ EXPECT_LINT_TRACE (traces, 0 , " " , " incoherent_exclusive_limits" ,
2486+ " `exclusiveMinimum` greater than or equal to "
2487+ " `exclusiveMaximum` makes the schema unsatisfiable" ,
2488+ true );
2489+ }
2490+
2491+ TEST (AlterSchema_lint_2019_09, incoherent_exclusive_limits_5) {
2492+ const sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
2493+ "$schema": "https://json-schema.org/draft/2019-09/schema",
2494+ "title": "Test",
2495+ "description": "A test schema",
2496+ "examples": [ "foo" ],
2497+ "exclusiveMaximum": 5
2498+ })JSON" );
2499+
2500+ LINT_WITHOUT_FIX (document, result, traces);
2501+
2502+ EXPECT_TRUE (result.first );
2503+ EXPECT_EQ (traces.size (), 0 );
2504+ }
2505+
24202506TEST (AlterSchema_lint_2019_09, equal_numeric_bounds_to_const_1) {
24212507 sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
24222508 "$schema": "https://json-schema.org/draft/2019-09/schema",
0 commit comments