From f1554b7d4d3742e5442fe92c25cb018b321f817b Mon Sep 17 00:00:00 2001 From: Tpt Date: Thu, 6 Dec 2018 11:00:52 +0100 Subject: [PATCH] Fixes some warnings in numeric_encoded tests --- lib/src/store/numeric_encoder.rs | 52 ++++++++++++++------------------ 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/lib/src/store/numeric_encoder.rs b/lib/src/store/numeric_encoder.rs index 065f35aa..90740698 100644 --- a/lib/src/store/numeric_encoder.rs +++ b/lib/src/store/numeric_encoder.rs @@ -702,36 +702,30 @@ impl Default for Encoder { } } -mod test { - use model::*; - use store::numeric_encoder::*; - - #[test] - fn test_encoding() { - let encoder: Encoder = Encoder::default(); - let terms: Vec = vec![ - NamedNode::from_str("http://foo.com").unwrap().into(), - NamedNode::from_str("http://bar.com").unwrap().into(), - NamedNode::from_str("http://foo.com").unwrap().into(), - BlankNode::default().into(), - Literal::new_simple_literal("foo").into(), - Literal::from(true).into(), - Literal::from(1.2).into(), - Literal::from(1).into(), - Literal::from("foo").into(), - Literal::new_language_tagged_literal("foo", "fr").into(), - ]; - for term in terms { - let encoded = encoder.encode_term(&term).unwrap(); - assert_eq!(term, encoder.decode_term(encoded).unwrap()) - } +#[test] +fn test_encoding() { + let encoder: Encoder = Encoder::default(); + let terms: Vec = vec![ + NamedNode::from_str("http://foo.com").unwrap().into(), + NamedNode::from_str("http://bar.com").unwrap().into(), + NamedNode::from_str("http://foo.com").unwrap().into(), + BlankNode::default().into(), + Literal::new_simple_literal("foo").into(), + Literal::from(true).into(), + Literal::from(1.2).into(), + Literal::from(1).into(), + Literal::from("foo").into(), + Literal::new_language_tagged_literal("foo", "fr").into(), + ]; + for term in terms { + let encoded = encoder.encode_term(&term).unwrap(); + assert_eq!(term, encoder.decode_term(encoded).unwrap()) } +} - #[test] - fn test_encoded_term_size() { - use std::mem::size_of; - - assert_eq!(size_of::(), 24); - } +#[test] +fn test_encoded_term_size() { + use std::mem::size_of; + assert_eq!(size_of::(), 24); }