Remove text_drection_from_lang_code
The test above should cover this sufficiently.
This commit is contained in:
parent
db877b1c9b
commit
869fe2f50d
111
src/config.rs
111
src/config.rs
|
@ -1248,117 +1248,6 @@ mod tests {
|
||||||
assert_eq!(cfg.realized_text_direction(), TextDirection::RightToLeft);
|
assert_eq!(cfg.realized_text_direction(), TextDirection::RightToLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn text_drection_from_lang_code() {
|
|
||||||
// test all right-to-left languages
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("ar"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("ara"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("arc"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("ae"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("ave"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("egy"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("he"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("heb"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("nqo"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("pal"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("phn"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("sam"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("syc"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("syr"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("fa"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("per"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("fas"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("ku"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("kur"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("ur"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("urd"),
|
|
||||||
TextDirection::RightToLeft
|
|
||||||
);
|
|
||||||
|
|
||||||
// test some left-to-right languages
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("de"),
|
|
||||||
TextDirection::LeftToRight
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("en"),
|
|
||||||
TextDirection::LeftToRight
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("es"),
|
|
||||||
TextDirection::LeftToRight
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("ja"),
|
|
||||||
TextDirection::LeftToRight
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
TextDirection::from_lang_code("sv"),
|
|
||||||
TextDirection::LeftToRight
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[should_panic(expected = "Invalid configuration file")]
|
#[should_panic(expected = "Invalid configuration file")]
|
||||||
fn invalid_language_type_error() {
|
fn invalid_language_type_error() {
|
||||||
|
|
Loading…
Reference in New Issue