File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
crates/detect/src/browser Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -162,11 +162,21 @@ mod tests {
162
162
163
163
#[ test]
164
164
fn test_url_regex ( ) {
165
- let landing_url = "https://meet.google.com/landing" ;
166
- assert ! ( !MEETING_REGEXES . iter( ) . any( |re| re. is_match( & landing_url) ) ) ;
165
+ let test_cases = [
166
+ ( "https://meet.google.com/landing" , false ) ,
167
+ ( "https://meet.google.com/tjw-fcje-ewx" , true ) ,
168
+ ] ;
167
169
168
- let meeting_url = "https://meet.google.com/tjw-fcje-ewx" ;
169
- assert ! ( MEETING_REGEXES . iter( ) . any( |re| re. is_match( & meeting_url) ) ) ;
170
+ for ( url, expected_match) in test_cases {
171
+ let matches = MEETING_REGEXES . iter ( ) . any ( |re| re. is_match ( url) ) ;
172
+ assert_eq ! (
173
+ matches,
174
+ expected_match,
175
+ "URL '{}' should {} match the regex" ,
176
+ url,
177
+ if expected_match { "" } else { "not " }
178
+ ) ;
179
+ }
170
180
}
171
181
172
182
#[ test]
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ impl<R: Runtime, T: Manager<R>> LocalLlmPluginExt<R> for T {
93
93
94
94
if let Err ( e) = download_file_with_callback ( url, path, callback) . await {
95
95
tracing:: error!( "model_download_error: {}" , e) ;
96
- channel. send ( -1 ) ;
96
+ let _ = channel. send ( -1 ) ;
97
97
}
98
98
} ) ;
99
99
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ impl<R: Runtime, T: Manager<R>> LocalSttPluginExt<R> for T {
134
134
download_file_with_callback ( m. model_url ( ) , m. model_path ( & data_dir) , callback) . await
135
135
{
136
136
tracing:: error!( "model_download_error: {}" , e) ;
137
- channel. send ( -1 ) ;
137
+ let _ = channel. send ( -1 ) ;
138
138
}
139
139
} ) ;
140
140
You can’t perform that action at this time.
0 commit comments