Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit 5ff9b54

Browse files
committed
Remove all jsonschema_valid tests from source
1 parent 006c982 commit 5ff9b54

File tree

10 files changed

+0
-165
lines changed

10 files changed

+0
-165
lines changed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,5 @@ schemars = { version = "0.8.0", optional = true }
2828
serde_test = "1.0"
2929
serde_json = "1.0"
3030

31-
[dev-dependencies.jsonschema-valid-compat]
32-
version = "0.4.1-alpha.1"
33-
3431
[target.wasm32-unknown-unknown.dev-dependencies]
3532
wasm-bindgen-test = "0.3"

src/hash160.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -167,24 +167,6 @@ mod tests {
167167
assert_tokens(&hash.compact(), &[Token::BorrowedBytes(&HASH_BYTES[..])]);
168168
assert_tokens(&hash.readable(), &[Token::Str("132072df690933835eb8b6ad0b77e7b6f14acad7")]);
169169
}
170-
171-
#[cfg(all(feature = "schemars",feature = "serde"))]
172-
#[test]
173-
fn jsonschema_accurate() {
174-
static HASH_BYTES: [u8; 20] = [
175-
0x13, 0x20, 0x72, 0xdf,
176-
0x69, 0x09, 0x33, 0x83,
177-
0x5e, 0xb8, 0xb6, 0xad,
178-
0x0b, 0x77, 0xe7, 0xb6,
179-
0xf1, 0x4a, 0xca, 0xd7,
180-
];
181-
182-
let hash = hash160::Hash::from_slice(&HASH_BYTES).expect("right number of bytes");
183-
let js = serde_json::from_str(&serde_json::to_string(&hash).unwrap()).unwrap();
184-
let s = schemars::schema_for! (hash160::Hash);
185-
let schema = serde_json::from_str(&serde_json::to_string(&s).unwrap()).unwrap();
186-
assert!(jsonschema_valid_compat::Config::from_schema(&schema, None).unwrap().validate(&js).is_ok());
187-
}
188170
}
189171

190172
#[cfg(all(test, feature="unstable"))]

src/hmac.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -387,27 +387,6 @@ mod tests {
387387
)],
388388
);
389389
}
390-
391-
#[cfg(all(feature = "schemars",feature = "serde"))]
392-
#[test]
393-
fn jsonschema_accurate() {
394-
static HASH_BYTES: [u8; 64] = [
395-
0x8b, 0x41, 0xe1, 0xb7, 0x8a, 0xd1, 0x15, 0x21,
396-
0x11, 0x3c, 0x52, 0xff, 0x18, 0x2a, 0x1b, 0x8e,
397-
0x0a, 0x19, 0x57, 0x54, 0xaa, 0x52, 0x7f, 0xcd,
398-
0x00, 0xa4, 0x11, 0x62, 0x0b, 0x46, 0xf2, 0x0f,
399-
0xff, 0xfb, 0x80, 0x88, 0xcc, 0xf8, 0x54, 0x97,
400-
0x12, 0x1a, 0xd4, 0x49, 0x9e, 0x08, 0x45, 0xb8,
401-
0x76, 0xf6, 0xdd, 0x66, 0x40, 0x08, 0x8a, 0x2f,
402-
0x0b, 0x2d, 0x8a, 0x60, 0x0b, 0xdf, 0x4c, 0x0c,
403-
];
404-
405-
let hash = Hmac::<sha512::Hash>::from_slice(&HASH_BYTES).expect("right number of bytes");
406-
let js = serde_json::from_str(&serde_json::to_string(&hash).unwrap()).unwrap();
407-
let s = schemars::schema_for! (Hmac::<sha512::Hash>);
408-
let schema = serde_json::from_str(&serde_json::to_string(&s).unwrap()).unwrap();
409-
assert!(jsonschema_valid_compat::Config::from_schema(&schema, None).unwrap().validate(&js).is_ok());
410-
}
411390
}
412391

413392
#[cfg(all(test, feature="unstable"))]

src/ripemd160.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -547,24 +547,6 @@ mod tests {
547547
assert_tokens(&hash.compact(), &[Token::BorrowedBytes(&HASH_BYTES[..])]);
548548
assert_tokens(&hash.readable(), &[Token::Str("132072df690933835eb8b6ad0b77e7b6f14acad7")]);
549549
}
550-
551-
#[cfg(all(feature = "schemars",feature = "serde"))]
552-
#[test]
553-
fn jsonschema_accurate() {
554-
static HASH_BYTES: [u8; 20] = [
555-
0x13, 0x20, 0x72, 0xdf,
556-
0x69, 0x09, 0x33, 0x83,
557-
0x5e, 0xb8, 0xb6, 0xad,
558-
0x0b, 0x77, 0xe7, 0xb6,
559-
0xf1, 0x4a, 0xca, 0xd7,
560-
];
561-
562-
let hash = ripemd160::Hash::from_slice(&HASH_BYTES).expect("right number of bytes");
563-
let js = serde_json::from_str(&serde_json::to_string(&hash).unwrap()).unwrap();
564-
let s = schemars::schema_for! (ripemd160::Hash);
565-
let schema = serde_json::from_str(&serde_json::to_string(&s).unwrap()).unwrap();
566-
assert!(jsonschema_valid_compat::Config::from_schema(&schema, None).unwrap().validate(&js).is_ok());
567-
}
568550
}
569551

570552
#[cfg(all(test, feature="unstable"))]

src/sha1.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -272,24 +272,6 @@ mod tests {
272272
assert_tokens(&hash.compact(), &[Token::BorrowedBytes(&HASH_BYTES[..])]);
273273
assert_tokens(&hash.readable(), &[Token::Str("132072df690933835eb8b6ad0b77e7b6f14acad7")]);
274274
}
275-
276-
#[cfg(all(feature = "schemars",feature = "serde"))]
277-
#[test]
278-
fn jsonschema_accurate() {
279-
static HASH_BYTES: [u8; 20] = [
280-
0x13, 0x20, 0x72, 0xdf,
281-
0x69, 0x09, 0x33, 0x83,
282-
0x5e, 0xb8, 0xb6, 0xad,
283-
0x0b, 0x77, 0xe7, 0xb6,
284-
0xf1, 0x4a, 0xca, 0xd7,
285-
];
286-
287-
let hash = sha1::Hash::from_slice(&HASH_BYTES).expect("right number of bytes");
288-
let js = serde_json::from_str(&serde_json::to_string(&hash).unwrap()).unwrap();
289-
let s = schemars::schema_for! (sha1::Hash);
290-
let schema = serde_json::from_str(&serde_json::to_string(&s).unwrap()).unwrap();
291-
assert!(jsonschema_valid_compat::Config::from_schema(&schema, None).unwrap().validate(&js).is_ok());
292-
}
293275
}
294276

295277
#[cfg(all(test, feature="unstable"))]

src/sha256.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -510,23 +510,6 @@ mod tests {
510510
assert_tokens(&hash.readable(), &[Token::Str("ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c")]);
511511
}
512512

513-
#[cfg(all(feature = "schemars",feature = "serde"))]
514-
#[test]
515-
fn jsonschema_accurate() {
516-
static HASH_BYTES: [u8; 32] = [
517-
0xef, 0x53, 0x7f, 0x25, 0xc8, 0x95, 0xbf, 0xa7,
518-
0x82, 0x52, 0x65, 0x29, 0xa9, 0xb6, 0x3d, 0x97,
519-
0xaa, 0x63, 0x15, 0x64, 0xd5, 0xd7, 0x89, 0xc2,
520-
0xb7, 0x65, 0x44, 0x8c, 0x86, 0x35, 0xfb, 0x6c,
521-
];
522-
523-
let hash = sha256::Hash::from_slice(&HASH_BYTES).expect("right number of bytes");
524-
let js = serde_json::from_str(&serde_json::to_string(&hash).unwrap()).unwrap();
525-
let s = schemars::schema_for! (sha256::Hash);
526-
let schema = serde_json::from_str(&serde_json::to_string(&s).unwrap()).unwrap();
527-
assert!(jsonschema_valid_compat::Config::from_schema(&schema, None).unwrap().validate(&js).is_ok());
528-
}
529-
530513
#[cfg(target_arch = "wasm32")]
531514
mod wasm_tests {
532515
extern crate wasm_bindgen_test;

src/sha256d.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -151,24 +151,6 @@ input: &'static str,
151151
assert_tokens(&hash.compact(), &[Token::BorrowedBytes(&HASH_BYTES[..])]);
152152
assert_tokens(&hash.readable(), &[Token::Str("6cfb35868c4465b7c289d7d5641563aa973db6a929655282a7bf95c8257f53ef")]);
153153
}
154-
155-
#[cfg(all(feature = "schemars",feature = "serde"))]
156-
#[test]
157-
fn jsonschema_accurate() {
158-
static HASH_BYTES: [u8; 32] = [
159-
0xef, 0x53, 0x7f, 0x25, 0xc8, 0x95, 0xbf, 0xa7,
160-
0x82, 0x52, 0x65, 0x29, 0xa9, 0xb6, 0x3d, 0x97,
161-
0xaa, 0x63, 0x15, 0x64, 0xd5, 0xd7, 0x89, 0xc2,
162-
0xb7, 0x65, 0x44, 0x8c, 0x86, 0x35, 0xfb, 0x6c,
163-
];
164-
165-
let hash = sha256d::Hash::from_slice(&HASH_BYTES).expect("right number of bytes");
166-
let js = serde_json::from_str(&serde_json::to_string(&hash).unwrap()).unwrap();
167-
let s = schemars::schema_for! (sha256d::Hash);
168-
let schema = serde_json::from_str(&serde_json::to_string(&s).unwrap()).unwrap();
169-
assert!(jsonschema_valid_compat::Config::from_schema(&schema, None).unwrap().validate(&js).is_ok());
170-
}
171-
172154
}
173155

174156
#[cfg(all(test, feature="unstable"))]

src/sha256t.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -271,21 +271,4 @@ mod tests {
271271
"29589d5122ec666ab5b4695070b6debc63881a4f85d88d93ddc90078038213ed"
272272
);
273273
}
274-
275-
#[cfg(all(feature = "schemars",feature = "serde"))]
276-
#[test]
277-
fn jsonschema_accurate() {
278-
static HASH_BYTES: [u8; 32] = [
279-
0xef, 0x53, 0x7f, 0x25, 0xc8, 0x95, 0xbf, 0xa7,
280-
0x82, 0x52, 0x65, 0x29, 0xa9, 0xb6, 0x3d, 0x97,
281-
0xaa, 0x63, 0x15, 0x64, 0xd5, 0xd7, 0x89, 0xc2,
282-
0xb7, 0x65, 0x44, 0x8c, 0x86, 0x35, 0xfb, 0x6c,
283-
];
284-
285-
let hash = TestHash::from_slice(&HASH_BYTES).expect("right number of bytes");
286-
let js = serde_json::from_str(&serde_json::to_string(&hash).unwrap()).unwrap();
287-
let s = schemars::schema_for! (TestHash);
288-
let schema = serde_json::from_str(&serde_json::to_string(&s).unwrap()).unwrap();
289-
assert!(jsonschema_valid_compat::Config::from_schema(&schema, None).unwrap().validate(&js).is_ok());
290-
}
291274
}

src/sha512.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -441,27 +441,6 @@ mod tests {
441441
)],
442442
);
443443
}
444-
445-
#[cfg(all(feature = "schemars",feature = "serde"))]
446-
#[test]
447-
fn jsonschema_accurate() {
448-
static HASH_BYTES: [u8; 64] = [
449-
0x8b, 0x41, 0xe1, 0xb7, 0x8a, 0xd1, 0x15, 0x21,
450-
0x11, 0x3c, 0x52, 0xff, 0x18, 0x2a, 0x1b, 0x8e,
451-
0x0a, 0x19, 0x57, 0x54, 0xaa, 0x52, 0x7f, 0xcd,
452-
0x00, 0xa4, 0x11, 0x62, 0x0b, 0x46, 0xf2, 0x0f,
453-
0xff, 0xfb, 0x80, 0x88, 0xcc, 0xf8, 0x54, 0x97,
454-
0x12, 0x1a, 0xd4, 0x49, 0x9e, 0x08, 0x45, 0xb8,
455-
0x76, 0xf6, 0xdd, 0x66, 0x40, 0x08, 0x8a, 0x2f,
456-
0x0b, 0x2d, 0x8a, 0x60, 0x0b, 0xdf, 0x4c, 0x0c,
457-
];
458-
459-
let hash = sha512::Hash::from_slice(&HASH_BYTES).expect("right number of bytes");
460-
let js = serde_json::from_str(&serde_json::to_string(&hash).unwrap()).unwrap();
461-
let s = schemars::schema_for! (sha512::Hash);
462-
let schema = serde_json::from_str(&serde_json::to_string(&s).unwrap()).unwrap();
463-
assert!(jsonschema_valid_compat::Config::from_schema(&schema, None).unwrap().validate(&js).is_ok());
464-
}
465444
}
466445

467446
#[cfg(all(test, feature="unstable"))]

src/siphash24.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -414,20 +414,6 @@ mod tests {
414414
state_inc.input(&[i as u8]);
415415
}
416416
}
417-
418-
#[cfg(all(feature = "schemars",feature = "serde"))]
419-
#[test]
420-
fn jsonschema_accurate() {
421-
static HASH_BYTES: [u8; 8] = [
422-
0x8b, 0x41, 0xe1, 0xb7, 0x8a, 0xd1, 0x15, 0x21,
423-
];
424-
425-
let hash = Hash::from_slice(&HASH_BYTES).expect("right number of bytes");
426-
let js = serde_json::from_str(&serde_json::to_string(&hash).unwrap()).unwrap();
427-
let s = schemars::schema_for! (Hash);
428-
let schema = serde_json::from_str(&serde_json::to_string(&s).unwrap()).unwrap();
429-
assert!(jsonschema_valid_compat::Config::from_schema(&schema, None).unwrap().validate(&js).is_ok());
430-
}
431417
}
432418

433419
#[cfg(all(test, feature = "unstable"))]

0 commit comments

Comments
 (0)