@@ -4,6 +4,52 @@ use std::path::PathBuf;
4
4
use walkdir:: WalkDir ;
5
5
6
6
const CRATE_DIR : & str = env ! ( "CARGO_MANIFEST_DIR" ) ;
7
+ const IGNORED : [ & str ; 44 ] = [
8
+ "fmt/161" ,
9
+ "fmt/276" ,
10
+ "fmt/301" ,
11
+ "fmt/302" ,
12
+ "fmt/433" ,
13
+ "fmt/435" ,
14
+ "fmt/532" ,
15
+ "fmt/558" ,
16
+ "fmt/62" ,
17
+ "fmt/63" ,
18
+ "fmt/64" ,
19
+ "fmt/65" ,
20
+ "fmt/66" ,
21
+ "fmt/67" ,
22
+ "fmt/68" ,
23
+ "fmt/69" ,
24
+ "fmt/70" ,
25
+ "fmt/71" ,
26
+ "fmt/72" ,
27
+ "fmt/73" ,
28
+ "fmt/74" ,
29
+ "fmt/75" ,
30
+ "fmt/76" ,
31
+ "fmt/77" ,
32
+ "fmt/78" ,
33
+ "fmt/79" ,
34
+ "fmt/96" ,
35
+ "fmt/950" ,
36
+ "fmt/1062" ,
37
+ "fmt/1105" ,
38
+ "fmt/1157" ,
39
+ "fmt/1389" ,
40
+ "fmt/1451" ,
41
+ "fmt/1739" ,
42
+ "fmt/1757" ,
43
+ "fmt/1796" ,
44
+ "fmt/1854" ,
45
+ "fmt/1871" ,
46
+ "fmt/2008" ,
47
+ "fmt/2009" ,
48
+ "x-fmt/91" ,
49
+ "x-fmt/142" ,
50
+ "x-fmt/178" ,
51
+ "x-fmt/280" ,
52
+ ] ;
7
53
8
54
fn data_dir ( ) -> PathBuf {
9
55
PathBuf :: from ( CRATE_DIR )
@@ -37,7 +83,7 @@ async fn test_file(file_name: &str) -> Result<(String, &FileType)> {
37
83
async fn test_file_classification ( ) -> Result < ( ) > {
38
84
let data_dir = data_dir ( ) ;
39
85
let mut passed_tests = 0 ;
40
- let mut failed_tests = 0 ;
86
+ let mut ignored_tests = 0 ;
41
87
42
88
for entry in WalkDir :: new ( data_dir) {
43
89
let entry = entry?;
@@ -53,21 +99,21 @@ async fn test_file_classification() -> Result<()> {
53
99
. to_string ( ) ;
54
100
let ( id, file_type) = test_file ( & file_name) . await ?;
55
101
56
- if file_type. id ( ) == id {
57
- assert_eq ! ( file_type. id( ) , id) ;
58
- passed_tests += 1 ;
59
- } else {
102
+ if IGNORED . contains ( & id. as_str ( ) ) {
60
103
eprintln ! (
61
104
"[ERROR] file_type.id()={}, id={}: {file_name}" ,
62
105
file_type. id( ) ,
63
106
id
64
107
) ;
65
- failed_tests += 1 ;
108
+ ignored_tests += 1 ;
109
+ continue ;
66
110
}
111
+ assert_eq ! ( file_type. id( ) , id) ;
112
+ passed_tests += 1 ;
67
113
}
68
114
69
115
println ! ( "Passed: {passed_tests}" ) ;
70
- println ! ( "Failed : {failed_tests }" ) ;
116
+ println ! ( "Ignored : {ignored_tests }" ) ;
71
117
Ok ( ( ) )
72
118
}
73
119
0 commit comments