Skip to content

Commit

Permalink
prefix all test functions with test_
Browse files Browse the repository at this point in the history
  • Loading branch information
rkusa committed Aug 3, 2020
1 parent 1db5a53 commit 038abb6
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion otf/src/lib.rs
Expand Up @@ -188,7 +188,7 @@ mod test {
use super::*;

#[test]
fn offset_table_encode_decode() {
fn test_offset_table_encode_decode() {
let data = include_bytes!("../tests/fonts/Iosevka/iosevka-regular.ttf");
let table = OffsetTable::unpack(&mut Cursor::new(data.to_vec())).unwrap();
assert_eq!(table.sfnt_version, SfntVersion::TrueType);
Expand Down
4 changes: 2 additions & 2 deletions otf/src/tables/cmap.rs
Expand Up @@ -128,7 +128,7 @@ mod test {
use crate::OffsetTable;

#[test]
fn cmap_table_encode_decode() {
fn test_cmap_table_encode_decode() {
let data = include_bytes!("../../tests/fonts/Iosevka/iosevka-regular.ttf");
let mut cursor = Cursor::new(data.to_vec());
let table = OffsetTable::unpack(&mut cursor).unwrap();
Expand All @@ -147,7 +147,7 @@ mod test {
}

#[test]
fn limit_read() {
fn test_limit_read() {
let data = "foobar".as_bytes().to_vec();
let mut rd = LimitRead::new(Cursor::new(data), 5);

Expand Down
2 changes: 1 addition & 1 deletion otf/src/tables/head.rs
Expand Up @@ -91,7 +91,7 @@ mod test {
use crate::OffsetTable;

#[test]
fn head_table_encode_decode() {
fn test_head_table_encode_decode() {
let data = include_bytes!("../../tests/fonts/Iosevka/iosevka-regular.ttf");
let mut cursor = Cursor::new(data.to_vec());
let table = OffsetTable::unpack(&mut cursor).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion otf/src/utils/limit_read.rs
Expand Up @@ -42,7 +42,7 @@ mod test {
use super::*;

#[test]
fn limit_read() {
fn test_limit_read() {
let data = "foobar".as_bytes().to_vec();
let mut rd = LimitRead::new(Cursor::new(data), 5);

Expand Down
4 changes: 2 additions & 2 deletions pdfrs/src/fonts/afm.rs
Expand Up @@ -63,15 +63,15 @@ mod test {
use crate::fonts::{Font, HELVETICA};

#[test]
fn encode_basic() {
fn test_encode_basic() {
let mut buf = Vec::new();
HELVETICA.encode("Hello", &mut buf).unwrap();
assert_eq!(buf.as_slice(), b"(Hello)");
assert_eq!(&String::from_utf8_lossy(&buf), "(Hello)");
}

#[test]
fn encode_reserved_characters() {
fn test_encode_reserved_characters() {
let mut buf = Vec::new();
HELVETICA.encode("Hello \\(World)", &mut buf).unwrap();
assert_eq!(&String::from_utf8_lossy(&buf), "(Hello \\\\\\(World\\))");
Expand Down
10 changes: 5 additions & 5 deletions pdfrs/src/layout/paragraph.rs
Expand Up @@ -92,7 +92,7 @@ mod test {
use super::*;

#[test]
fn paragraph_chunks_optional_break() {
fn test_paragraph_chunks_optional_break() {
let style = Style {
font: &*crate::fonts::HELVETICA,
};
Expand Down Expand Up @@ -122,7 +122,7 @@ mod test {
}

#[test]
fn paragraph_chunks_mandatory_break() {
fn test_paragraph_chunks_mandatory_break() {
let style = Style {
font: &*crate::fonts::HELVETICA,
};
Expand Down Expand Up @@ -152,7 +152,7 @@ mod test {
}

#[test]
fn paragraph_chunks_multiple_text_nodes() {
fn test_paragraph_chunks_multiple_text_nodes() {
let style = Style {
font: &*crate::fonts::HELVETICA,
};
Expand Down Expand Up @@ -188,7 +188,7 @@ mod test {
}

#[test]
fn paragraph_chunks_two_nodes_without_breaks() {
fn test_paragraph_chunks_two_nodes_without_breaks() {
let style = Style {
font: &*crate::fonts::HELVETICA,
};
Expand Down Expand Up @@ -224,7 +224,7 @@ mod test {
}

#[test]
fn paragraph_chunks_three_nodes_without_breaks() {
fn test_paragraph_chunks_three_nodes_without_breaks() {
let style = Style {
font: &*crate::fonts::HELVETICA,
};
Expand Down
4 changes: 2 additions & 2 deletions serde_pdf/src/object.rs
Expand Up @@ -165,7 +165,7 @@ mod test {
use crate::ser::to_string;

#[test]
fn serialize_object() {
fn test_serialize_object() {
let obj: Object<()> = Object {
id: ObjectId::new(3, 1),
..Object::default()
Expand All @@ -174,7 +174,7 @@ mod test {
}

#[test]
fn serialize_reference() {
fn test_serialize_reference() {
let obj: Object<()> = Object {
id: ObjectId::new(3, 1),
..Object::default()
Expand Down
4 changes: 2 additions & 2 deletions serde_pdf/src/stream.rs
Expand Up @@ -62,7 +62,7 @@ mod test {
use crate::ser::to_string;

#[test]
fn serialize() {
fn test_serialize() {
let mut dict: HashMap<String, Value> = HashMap::new();
dict.insert("foo".to_string(), Value::String("bar".to_string()));

Expand All @@ -77,7 +77,7 @@ mod test {
}

#[test]
fn serialize_dict_only() {
fn test_serialize_dict_only() {
let mut dict: HashMap<String, Value> = HashMap::new();
dict.insert("foo".to_string(), Value::String("bar".to_string()));

Expand Down
8 changes: 4 additions & 4 deletions serde_pdf/src/string.rs
Expand Up @@ -119,25 +119,25 @@ mod test {
use crate::ser::to_string;

#[test]
fn serialize_hex_string() {
fn test_serialize_hex_string() {
let s = PdfString::Hex(String::from("foobar"));
assert_eq!(to_string(&s).unwrap(), "<475050434253>");
}

#[test]
fn serialize_hex_str() {
fn test_serialize_hex_str() {
let s = PdfStr::Hex("foobar");
assert_eq!(to_string(&s).unwrap(), "<475050434253>");
}

#[test]
fn serialize_literal_string() {
fn test_serialize_literal_string() {
let s = PdfString::Literal(String::from(r#"0ab(\fo)?!€"#));
assert_eq!(to_string(&s).unwrap(), r#"(0ab\(\\fo\)?!\200)"#);
}

#[test]
fn serialize_literal_str() {
fn test_serialize_literal_str() {
let s = PdfStr::Literal(r#"0ab(\fo)?!€"#);
assert_eq!(to_string(&s).unwrap(), r#"(0ab\(\\fo\)?!\200)"#);
}
Expand Down

0 comments on commit 038abb6

Please sign in to comment.