From ee27711b65a97ba3db2ec19dcaf99791600d9985 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 13 Feb 2020 09:10:52 +1000 Subject: [PATCH] remove redundant test_ prefix --- rslib/src/cloze.rs | 2 +- rslib/src/media/changetracker.rs | 2 +- rslib/src/media/check.rs | 4 ++-- rslib/src/media/database.rs | 2 +- rslib/src/sched.rs | 10 +++++----- rslib/src/template.rs | 12 ++++++------ rslib/src/template_filters.rs | 10 +++++----- rslib/src/text.rs | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/rslib/src/cloze.rs b/rslib/src/cloze.rs index 820a2077c..244e0ee63 100644 --- a/rslib/src/cloze.rs +++ b/rslib/src/cloze.rs @@ -145,7 +145,7 @@ mod test { use std::collections::HashSet; #[test] - fn test_cloze() { + fn cloze() { assert_eq!( cloze_numbers_in_string("test"), vec![].into_iter().collect::>() diff --git a/rslib/src/media/changetracker.rs b/rslib/src/media/changetracker.rs index 208f3cbb2..555a80453 100644 --- a/rslib/src/media/changetracker.rs +++ b/rslib/src/media/changetracker.rs @@ -245,7 +245,7 @@ mod test { } #[test] - fn test_change_tracking() -> Result<()> { + fn change_tracking() -> Result<()> { let dir = tempdir()?; let media_dir = dir.path().join("media"); std::fs::create_dir(&media_dir)?; diff --git a/rslib/src/media/check.rs b/rslib/src/media/check.rs index 6e7aea4a7..064355d04 100644 --- a/rslib/src/media/check.rs +++ b/rslib/src/media/check.rs @@ -361,7 +361,7 @@ mod test { } #[test] - fn test_media_check() -> Result<()> { + fn media_check() -> Result<()> { let (_dir, mgr, col_path) = common_setup()?; // add some test files @@ -395,7 +395,7 @@ mod test { } #[test] - fn test_unicode_normalization() -> Result<()> { + fn unicode_normalization() -> Result<()> { let (_dir, mgr, col_path) = common_setup()?; fs::write(&mgr.media_folder.join("ぱぱ.jpg"), "nfd encoding")?; diff --git a/rslib/src/media/database.rs b/rslib/src/media/database.rs index 0bbccab27..5d639f902 100644 --- a/rslib/src/media/database.rs +++ b/rslib/src/media/database.rs @@ -257,7 +257,7 @@ mod test { use tempfile::NamedTempFile; #[test] - fn test_database() -> Result<()> { + fn database() -> Result<()> { let db_file = NamedTempFile::new()?; let db_file_path = db_file.path().to_str().unwrap(); let mut mgr = MediaManager::new("/dummy", db_file_path)?; diff --git a/rslib/src/sched.rs b/rslib/src/sched.rs index 0caf053c5..6edd1669a 100644 --- a/rslib/src/sched.rs +++ b/rslib/src/sched.rs @@ -99,7 +99,7 @@ mod test { use chrono::{FixedOffset, Local, TimeZone, Utc}; #[test] - fn test_rollover() { + fn rollover() { assert_eq!(normalized_rollover_hour(4), 4); assert_eq!(normalized_rollover_hour(23), 23); assert_eq!(normalized_rollover_hour(24), 23); @@ -110,7 +110,7 @@ mod test { } #[test] - fn test_fixed_offset() { + fn fixed_offset() { let offset = fixed_offset_from_minutes(-600); assert_eq!(offset.utc_minus_local(), -600 * 60); } @@ -125,14 +125,14 @@ mod test { #[cfg(target_vendor = "apple")] /// On Linux, TZ needs to be set prior to the process being started to take effect, /// so we limit this test to Macs. - fn test_local_minutes_west() { + fn local_minutes_west() { // -480 throughout the year std::env::set_var("TZ", "Australia/Perth"); assert_eq!(local_minutes_west_for_stamp(Utc::now().timestamp()), -480); } #[test] - fn test_days_elapsed() { + fn days_elapsed() { let local_offset = local_minutes_west_for_stamp(Utc::now().timestamp()); let created_dt = FixedOffset::west(local_offset * 60) @@ -221,7 +221,7 @@ mod test { } #[test] - fn test_next_day_at() { + fn next_day_at() { let rollhour = 4; let crt = Local.ymd(2019, 1, 1).and_hms(2, 0, 0); diff --git a/rslib/src/template.rs b/rslib/src/template.rs index 739c771c6..318d26376 100644 --- a/rslib/src/template.rs +++ b/rslib/src/template.rs @@ -547,7 +547,7 @@ mod test { use std::iter::FromIterator; #[test] - fn test_field_empty() { + fn field_empty() { assert_eq!(field_is_empty(""), true); assert_eq!(field_is_empty(" "), true); assert_eq!(field_is_empty("x"), false); @@ -558,7 +558,7 @@ mod test { } #[test] - fn test_parsing() { + fn parsing() { let tmpl = PT::from_text("foo {{bar}} {{#baz}} quux {{/baz}}").unwrap(); assert_eq!( tmpl.0, @@ -606,7 +606,7 @@ mod test { } #[test] - fn test_nonempty() { + fn nonempty() { let fields = HashSet::from_iter(vec!["1", "3"].into_iter()); let mut tmpl = PT::from_text("{{2}}{{1}}").unwrap(); assert_eq!(tmpl.renders_with_fields(&fields), true); @@ -619,7 +619,7 @@ mod test { } #[test] - fn test_requirements() { + fn requirements() { let field_map: FieldMap = vec!["a", "b"] .iter() .enumerate() @@ -680,7 +680,7 @@ mod test { } #[test] - fn test_alt_syntax() { + fn alt_syntax() { let input = " {{=<% %>=}} <%Front%> @@ -695,7 +695,7 @@ mod test { } #[test] - fn test_render_single() { + fn render_single() { let map: HashMap<_, _> = vec![("F", "f"), ("B", "b"), ("E", " ")] .into_iter() .collect(); diff --git a/rslib/src/template_filters.rs b/rslib/src/template_filters.rs index fc9e27532..b0c500d8b 100644 --- a/rslib/src/template_filters.rs +++ b/rslib/src/template_filters.rs @@ -204,7 +204,7 @@ mod test { use crate::text::strip_html; #[test] - fn test_furigana() { + fn furigana() { let text = "test first[second] third[fourth]"; assert_eq!(kana_filter(text).as_ref(), "testsecondfourth"); assert_eq!(kanji_filter(text).as_ref(), "testfirstthird"); @@ -215,7 +215,7 @@ mod test { } #[test] - fn test_hint() { + fn hint() { assert_eq!( hint_filter("foo", "field"), r##" @@ -230,7 +230,7 @@ field } #[test] - fn test_type() { + fn typing() { assert_eq!(type_filter("Front"), "[[type:Front]]"); assert_eq!(type_cloze_filter("Front"), "[[type:cloze:Front]]"); let ctx = RenderContext { @@ -246,7 +246,7 @@ field } #[test] - fn test_cloze() { + fn cloze() { let text = "{{c1::one}} {{c2::two::hint}}"; let mut ctx = RenderContext { fields: &Default::default(), @@ -274,7 +274,7 @@ field } #[test] - fn test_tts() { + fn tts() { assert_eq!( tts_filter("tts en_US voices=Bob,Jane", "foo"), "[anki:tts][en_US voices=Bob,Jane]foo[/anki:tts]" diff --git a/rslib/src/text.rs b/rslib/src/text.rs index 300ab6f90..b5055e4e5 100644 --- a/rslib/src/text.rs +++ b/rslib/src/text.rs @@ -227,7 +227,7 @@ mod test { }; #[test] - fn test_stripping() { + fn stripping() { assert_eq!(strip_html("test"), "test"); assert_eq!(strip_html("test"), "test"); assert_eq!(strip_html("some"), "some"); @@ -244,7 +244,7 @@ mod test { } #[test] - fn test_audio() { + fn audio() { let s = "abc[sound:fo&o.mp3]def[anki:tts][en_US voices=Bob,Jane speed=1.2]foo
1>2[/anki:tts]gh"; assert_eq!(strip_av_tags(s), "abcdefgh");