@@ -10,7 +10,7 @@ use reqwest::{
10
10
use serde:: Deserialize ;
11
11
use std:: sync:: Arc ;
12
12
13
- use crate :: utils :: { Updater , APP_USER_AGENT } ;
13
+ use crate :: repositories :: { Updater , APP_USER_AGENT } ;
14
14
15
15
const GRAPHQL_UPDATE : & str = "query($ids: [ID!]!) {
16
16
nodes(ids: $ids) {
@@ -309,7 +309,7 @@ struct GraphIssues {
309
309
#[ cfg( test) ]
310
310
mod test {
311
311
use super :: * ;
312
- use crate :: utils :: RepositoryName ;
312
+ use crate :: repositories :: RepositoryName ;
313
313
314
314
#[ test]
315
315
fn test_repository_name ( ) {
@@ -324,16 +324,20 @@ mod test {
324
324
} )
325
325
) ;
326
326
} ;
327
+ ( $url: expr => None ) => {
328
+ assert_eq!( GithubUpdater :: repository_name( $url) , None ) ;
329
+ } ;
327
330
}
328
331
329
332
assert_name ! ( "https://github.com/onur/cratesfyi" => ( "onur" , "cratesfyi" , "github.com" ) ) ;
330
333
assert_name ! ( "http://github.com/onur/cratesfyi" => ( "onur" , "cratesfyi" , "github.com" ) ) ;
331
- assert_name ! ( "https://www.github.com/onur/cratesfyi" => ( "onur" , "cratesfyi" , "www.github.com" ) ) ;
332
- assert_name ! ( "http://www.github.com/onur/cratesfyi" => ( "onur" , "cratesfyi" , "www.github.com" ) ) ;
333
334
assert_name ! ( "https://github.com/onur/cratesfyi.git" => ( "onur" , "cratesfyi" , "github.com" ) ) ;
334
335
assert_name ! ( "https://github.com/docopt/docopt.rs" => ( "docopt" , "docopt.rs" , "github.com" ) ) ;
335
336
assert_name ! ( "https://github.com/onur23cmD_M_R_L_/crates_fy-i" => (
336
337
"onur23cmD_M_R_L_" , "crates_fy-i" , "github.com"
337
338
) ) ;
339
+ assert_name ! ( "https://www.github.com/onur/cratesfyi" => None ) ;
340
+ assert_name ! ( "http://www.github.com/onur/cratesfyi" => None ) ;
341
+ assert_name ! ( "http://www.gitlab.com/onur/cratesfyi" => None ) ;
338
342
}
339
343
}
0 commit comments