|
|
@ -702,12 +702,8 @@ impl<S: StringStore + Default> Default for Encoder<S> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mod test { |
|
|
|
#[test] |
|
|
|
use model::*; |
|
|
|
fn test_encoding() { |
|
|
|
use store::numeric_encoder::*; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
|
|
|
fn test_encoding() { |
|
|
|
|
|
|
|
let encoder: Encoder<MemoryStringStore> = Encoder::default(); |
|
|
|
let encoder: Encoder<MemoryStringStore> = Encoder::default(); |
|
|
|
let terms: Vec<Term> = vec![ |
|
|
|
let terms: Vec<Term> = vec![ |
|
|
|
NamedNode::from_str("http://foo.com").unwrap().into(), |
|
|
|
NamedNode::from_str("http://foo.com").unwrap().into(), |
|
|
@ -725,13 +721,11 @@ mod test { |
|
|
|
let encoded = encoder.encode_term(&term).unwrap(); |
|
|
|
let encoded = encoder.encode_term(&term).unwrap(); |
|
|
|
assert_eq!(term, encoder.decode_term(encoded).unwrap()) |
|
|
|
assert_eq!(term, encoder.decode_term(encoded).unwrap()) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
fn test_encoded_term_size() { |
|
|
|
fn test_encoded_term_size() { |
|
|
|
use std::mem::size_of; |
|
|
|
use std::mem::size_of; |
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(size_of::<EncodedTerm>(), 24); |
|
|
|
assert_eq!(size_of::<EncodedTerm>(), 24); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|