File: tolerate-unsupported-locales.diff

package info (click to toggle)
rust-num-format 0.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 564 kB
  • sloc: makefile: 2
file content (20 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Index: num-format/tests/test_system_locale_unix.rs
===================================================================
--- num-format.orig/tests/test_system_locale_unix.rs
+++ num-format/tests/test_system_locale_unix.rs
@@ -19,9 +19,13 @@ fn test_unix() {
     assert!(!vec.is_empty());
     for name in &vec {
         println!("{}", name);
-        let locale1 = SystemLocale::from_name(name.to_string()).unwrap();
+        let locale1 = SystemLocale::from_name(name.to_string());
         env::set_var("LC_ALL", name);
-        let locale2 = SystemLocale::default().unwrap();
+        let locale2 = SystemLocale::default();
         assert_eq!(locale1, locale2);
+        match name.as_ref() {
+            "kk_KZ.rk1048" | "lzh_TW" | "zh_TW.euctw" | "unm_US" | "cmn_TW" | "nan_TW" | "hak_TW" | "ka_GE" | "tg_TJ" => {}, //locales that are known to be unsupported, either due to unsupported encodings or unsupported digit groupings.
+            _ => {locale1.unwrap();}, //most locales should be parsed successfully.
+        }
     }
 }