1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
diff --git a/Cargo.toml b/Cargo.toml
index 65375b0..8b56e54 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -37,29 +37,29 @@ retrieve-async = [
name = "referencing"
path = "src/lib.rs"
-[[test]]
-name = "suite"
-path = "tests/suite.rs"
-
-[[bench]]
-name = "anchor"
-path = "benches/anchor.rs"
-harness = false
-
-[[bench]]
-name = "pointer"
-path = "benches/pointer.rs"
-harness = false
-
-[[bench]]
-name = "registry"
-path = "benches/registry.rs"
-harness = false
-
-[[bench]]
-name = "subresources"
-path = "benches/subresources.rs"
-harness = false
+#[[test]]
+#name = "suite"
+#path = "tests/suite.rs"
+
+#[[bench]]
+#name = "anchor"
+#path = "benches/anchor.rs"
+#harness = false
+
+#[[bench]]
+#name = "pointer"
+#path = "benches/pointer.rs"
+#harness = false
+
+#[[bench]]
+#name = "registry"
+#path = "benches/registry.rs"
+#harness = false
+
+#[[bench]]
+#name = "subresources"
+#path = "benches/subresources.rs"
+#harness = false
[dependencies.ahash]
version = "0.8"
@@ -89,13 +89,13 @@ version = "2.3.1"
[dependencies.serde_json]
version = "1"
-[dev-dependencies.codspeed-criterion-compat]
-version = "4.1"
-default-features = false
+#[dev-dependencies.codspeed-criterion-compat]
+#version = "4.1"
+#default-features = false
-[dev-dependencies.criterion]
-version = "0.7"
-default-features = false
+#[dev-dependencies.criterion]
+#version = "0.7"
+#default-features = false
[dev-dependencies.getrandom]
version = "0.2"
diff --git a/tests/suite.rs b/tests/suite.rs
deleted file mode 100644
index 967392a..0000000
--- a/tests/suite.rs
+++ /dev/null
@@ -1,76 +0,0 @@
-use referencing::{Draft, Registry};
-use referencing_testsuite::{suite, Test};
-
-#[suite(
- path = "crates/jsonschema-referencing/tests/suite",
- drafts = [
- "json-schema-draft-04",
- "json-schema-draft-06",
- "json-schema-draft-07",
- "json-schema-draft-2019-09",
- "json-schema-draft-2020-12",
- ],
- xfail = [
- // `fluent-uri` does not normalize 80 port
- "json-schema-draft-04::rfc3986_normalization_on_insertion::test_5",
- "json-schema-draft-04::rfc3986_normalization_on_insertion::test_11",
- "json-schema-draft-04::rfc3986_normalization_on_retrieval::test_5",
- "json-schema-draft-04::rfc3986_normalization_on_retrieval::test_11",
- "json-schema-draft-06::rfc3986_normalization_on_insertion::test_5",
- "json-schema-draft-06::rfc3986_normalization_on_insertion::test_11",
- "json-schema-draft-06::rfc3986_normalization_on_retrieval::test_5",
- "json-schema-draft-06::rfc3986_normalization_on_retrieval::test_11",
- "json-schema-draft-07::rfc3986_normalization_on_insertion::test_5",
- "json-schema-draft-07::rfc3986_normalization_on_insertion::test_11",
- "json-schema-draft-07::rfc3986_normalization_on_retrieval::test_5",
- "json-schema-draft-07::rfc3986_normalization_on_retrieval::test_11",
- "json-schema-draft-2019-09::rfc3986_normalization_on_insertion::test_5",
- "json-schema-draft-2019-09::rfc3986_normalization_on_insertion::test_11",
- "json-schema-draft-2019-09::rfc3986_normalization_on_retrieval::test_5",
- "json-schema-draft-2019-09::rfc3986_normalization_on_retrieval::test_11",
- "json-schema-draft-2020-12::rfc3986_normalization_on_insertion::test_5",
- "json-schema-draft-2020-12::rfc3986_normalization_on_insertion::test_11",
- "json-schema-draft-2020-12::rfc3986_normalization_on_retrieval::test_5",
- "json-schema-draft-2020-12::rfc3986_normalization_on_retrieval::test_11",
- ]
-)]
-fn test_suite(draft: &'static str, test: Test) {
- let draft = match draft {
- "json-schema-draft-04" => Draft::Draft4,
- "json-schema-draft-06" => Draft::Draft6,
- "json-schema-draft-07" => Draft::Draft7,
- "json-schema-draft-2019-09" => Draft::Draft201909,
- "json-schema-draft-2020-12" => Draft::Draft202012,
- _ => panic!("Unknown draft"),
- };
- let registry = Registry::try_from_resources(
- test.registry
- .into_iter()
- .map(|(uri, content)| (uri, draft.create_resource(content))),
- )
- .expect("Invalid registry");
- let resolver = registry
- .try_resolver(test.base_uri.unwrap_or_default())
- .expect("Invalid base URI");
- if test.error.is_some() {
- assert!(resolver.lookup(test.reference).is_err());
- } else {
- let mut resolved = resolver.lookup(test.reference).expect("Invalid reference");
- assert_eq!(
- resolved.contents(),
- &test.target.expect("Should be present")
- );
- let mut then = test.then;
- while let Some(then_) = then {
- resolved = resolved
- .resolver()
- .lookup(then_.reference)
- .expect("Invalid reference");
- assert_eq!(
- resolved.contents(),
- &then_.target.expect("Should be present")
- );
- then = then_.then;
- }
- }
-}
|