1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
pub mod utils;
pub mod categories;
pub mod desktop_entry;
pub mod basedir;
pub mod icon_theme;
pub mod desktop_menu;
#[cfg(test)]
mod tests {
use crate::utils::*;
use crate::basedir::*;
#[test]
fn basedir_test(){
if cfg!(target_os = "linux") {
let res = data_dirs();
let result2 = res.unwrap().to_owned();
let vec:Vec<String> = convert_to_vec(data_dirs());
assert!(!result2.is_empty() && !vec.is_empty());
}
}
#[test]
fn desktop_entry_test_good() {
}
#[test]
fn desktop_entry_test_bad() {
}
#[test]
fn utils_converter() {
let true_bool:String = "true".to_string();
assert_eq!(Some(true), to_bool(Some(true_bool)));
let one_int:String = "1".to_string();
assert_eq!(Some(1), to_int(Some(one_int)));
if cfg!(target_os = "linux") {
let lang = get_language();
assert_ne!(None, lang);
}
}
}