1
+ use tester as test;
2
+
1
3
#[ macro_use]
2
4
extern crate serde;
3
5
@@ -32,7 +34,7 @@ fn run_data_url(
32
34
33
35
fn collect_data_url < F > ( add_test : & mut F )
34
36
where
35
- F : FnMut ( String , bool , rustc_test :: TestFn ) ,
37
+ F : FnMut ( String , bool , test :: TestFn ) ,
36
38
{
37
39
let known_failures = [ "data://test:test/,X" ] ;
38
40
53
55
add_test (
54
56
format ! ( "data: URL {:?}" , input) ,
55
57
should_panic,
56
- rustc_test :: TestFn :: dyn_test_fn ( move || {
58
+ test :: TestFn :: DynTestFn ( Box :: new ( move || {
57
59
run_data_url ( input, expected_mime, expected_body, should_panic)
58
- } ) ,
60
+ } ) ) ,
59
61
) ;
60
62
}
61
63
}
@@ -72,7 +74,7 @@ fn run_base64(input: String, expected: Option<Vec<u8>>) {
72
74
73
75
fn collect_base64 < F > ( add_test : & mut F )
74
76
where
75
- F : FnMut ( String , bool , rustc_test :: TestFn ) ,
77
+ F : FnMut ( String , bool , test :: TestFn ) ,
76
78
{
77
79
let known_failures = [ ] ;
78
80
83
85
add_test (
84
86
format ! ( "base64 {:?}" , input) ,
85
87
should_panic,
86
- rustc_test :: TestFn :: dyn_test_fn ( move || run_base64 ( input, expected) ) ,
88
+ test :: TestFn :: DynTestFn ( Box :: new ( move || run_base64 ( input, expected) ) ) ,
87
89
) ;
88
90
}
89
91
}
@@ -100,7 +102,7 @@ fn run_mime(input: String, expected: Option<String>) {
100
102
101
103
fn collect_mime < F > ( add_test : & mut F )
102
104
where
103
- F : FnMut ( String , bool , rustc_test :: TestFn ) ,
105
+ F : FnMut ( String , bool , test :: TestFn ) ,
104
106
{
105
107
let known_failures = [ ] ;
106
108
@@ -136,24 +138,30 @@ where
136
138
format ! ( "MIME type {:?}" , input)
137
139
} ,
138
140
should_panic,
139
- rustc_test :: TestFn :: dyn_test_fn ( move || run_mime ( input, expected) ) ,
141
+ test :: TestFn :: DynTestFn ( Box :: new ( move || run_mime ( input, expected) ) ) ,
140
142
) ;
141
143
}
142
144
}
143
145
144
146
fn main ( ) {
145
147
let mut tests = Vec :: new ( ) ;
146
148
{
147
- let mut add_one = |name : String , should_panic : bool , run : rustc_test:: TestFn | {
148
- let mut desc = rustc_test:: TestDesc :: new ( rustc_test:: DynTestName ( name) ) ;
149
- if should_panic {
150
- desc. should_panic = rustc_test:: ShouldPanic :: Yes
151
- }
152
- tests. push ( rustc_test:: TestDescAndFn { desc, testfn : run } )
149
+ let mut add_one = |name : String , should_panic : bool , run : test:: TestFn | {
150
+ let desc = test:: TestDesc {
151
+ name : test:: DynTestName ( name) ,
152
+ ignore : false ,
153
+ should_panic : match should_panic {
154
+ true => test:: ShouldPanic :: Yes ,
155
+ false => test:: ShouldPanic :: No ,
156
+ } ,
157
+ allow_fail : false ,
158
+ test_type : test:: TestType :: Unknown ,
159
+ } ;
160
+ tests. push ( test:: TestDescAndFn { desc, testfn : run } )
153
161
} ;
154
162
collect_data_url ( & mut add_one) ;
155
163
collect_base64 ( & mut add_one) ;
156
164
collect_mime ( & mut add_one) ;
157
165
}
158
- rustc_test :: test_main ( & std:: env:: args ( ) . collect :: < Vec < _ > > ( ) , tests)
166
+ test :: test_main ( & std:: env:: args ( ) . collect :: < Vec < _ > > ( ) , tests, None )
159
167
}
0 commit comments