@@ -1291,6 +1291,92 @@ TEST(AlterSchema_lint_draft6, exclusive_minimum_integer_to_minimum_4) {
12911291 EXPECT_EQ (document, expected);
12921292}
12931293
1294+ TEST (AlterSchema_lint_draft6, incoherent_exclusive_limits_1) {
1295+ const sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
1296+ "$schema": "http://json-schema.org/draft-06/schema#",
1297+ "title": "Test",
1298+ "description": "A test schema",
1299+ "examples": [ "foo" ],
1300+ "exclusiveMinimum": 1,
1301+ "exclusiveMaximum": 5
1302+ })JSON" );
1303+
1304+ LINT_WITHOUT_FIX (document, result, traces);
1305+
1306+ EXPECT_TRUE (result.first );
1307+ EXPECT_EQ (traces.size (), 0 );
1308+ }
1309+
1310+ TEST (AlterSchema_lint_draft6, incoherent_exclusive_limits_2) {
1311+ const sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
1312+ "$schema": "http://json-schema.org/draft-06/schema#",
1313+ "title": "Test",
1314+ "description": "A test schema",
1315+ "examples": [ "foo" ],
1316+ "exclusiveMinimum": 1
1317+ })JSON" );
1318+
1319+ LINT_WITHOUT_FIX (document, result, traces);
1320+
1321+ EXPECT_TRUE (result.first );
1322+ EXPECT_EQ (traces.size (), 0 );
1323+ }
1324+
1325+ TEST (AlterSchema_lint_draft6, incoherent_exclusive_limits_3) {
1326+ const sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
1327+ "$schema": "http://json-schema.org/draft-06/schema#",
1328+ "title": "Test",
1329+ "description": "A test schema",
1330+ "examples": [ "foo" ],
1331+ "exclusiveMinimum": 3,
1332+ "exclusiveMaximum": 3
1333+ })JSON" );
1334+
1335+ LINT_WITHOUT_FIX (document, result, traces);
1336+
1337+ EXPECT_FALSE (result.first );
1338+ EXPECT_EQ (traces.size (), 1 );
1339+ EXPECT_LINT_TRACE (traces, 0 , " " , " incoherent_exclusive_limits" ,
1340+ " `exclusiveMinimum` greater than or equal to "
1341+ " `exclusiveMaximum` makes the schema unsatisfiable" ,
1342+ false );
1343+ }
1344+
1345+ TEST (AlterSchema_lint_draft6, incoherent_exclusive_limits_4) {
1346+ const sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
1347+ "$schema": "http://json-schema.org/draft-06/schema#",
1348+ "title": "Test",
1349+ "description": "A test schema",
1350+ "examples": [ "foo" ],
1351+ "exclusiveMinimum": 5,
1352+ "exclusiveMaximum": 2
1353+ })JSON" );
1354+
1355+ LINT_WITHOUT_FIX (document, result, traces);
1356+
1357+ EXPECT_FALSE (result.first );
1358+ EXPECT_EQ (traces.size (), 1 );
1359+ EXPECT_LINT_TRACE (traces, 0 , " " , " incoherent_exclusive_limits" ,
1360+ " `exclusiveMinimum` greater than or equal to "
1361+ " `exclusiveMaximum` makes the schema unsatisfiable" ,
1362+ false );
1363+ }
1364+
1365+ TEST (AlterSchema_lint_draft6, incoherent_exclusive_limits_5) {
1366+ const sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
1367+ "$schema": "http://json-schema.org/draft-06/schema#",
1368+ "title": "Test",
1369+ "description": "A test schema",
1370+ "examples": [ "foo" ],
1371+ "exclusiveMaximum": 5
1372+ })JSON" );
1373+
1374+ LINT_WITHOUT_FIX (document, result, traces);
1375+
1376+ EXPECT_TRUE (result.first );
1377+ EXPECT_EQ (traces.size (), 0 );
1378+ }
1379+
12941380TEST (AlterSchema_lint_draft6, equal_numeric_bounds_to_const_1) {
12951381 sourcemeta::core::JSON document = sourcemeta::core::parse_json (R"JSON( {
12961382 "$schema": "http://json-schema.org/draft-06/schema#",
0 commit comments