File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,18 +60,18 @@ arg_enum! {
6060 }
6161}
6262
63- #[ derive( Debug ) ]
63+ #[ derive( Debug , PartialEq ) ]
6464pub enum Repo {
6565 Pypi ( PypiRepo ) ,
6666 Github ( GithubRepo ) ,
6767}
6868
69- #[ derive( Debug ) ]
69+ #[ derive( Debug , PartialEq ) ]
7070pub struct PypiRepo {
7171 pub project : String ,
7272}
7373
74- #[ derive( Debug ) ]
74+ #[ derive( Debug , PartialEq ) ]
7575pub struct GithubRepo {
7676 pub owner : String ,
7777 pub repo : String ,
Original file line number Diff line number Diff line change @@ -302,6 +302,8 @@ pub fn read_meta_from_url(url: &str, info: &mut types::ExpressionInfo) {
302302mod tests {
303303 use super :: * ;
304304 use pretty_assertions:: assert_eq;
305+ use crate :: types:: Repo :: Github ;
306+ use crate :: types:: GithubRepo ;
305307
306308 #[ test]
307309 fn test_url_parse ( ) {
@@ -311,8 +313,10 @@ mod tests {
311313 )
312314 . unwrap ( ) ;
313315
314- assert_eq ! ( repo. owner, "jonringer" ) ;
315- assert_eq ! ( repo. repo, "nix-template" ) ;
316+ assert_eq ! ( repo, Github ( GithubRepo {
317+ owner: "jonringer" . to_string( ) ,
318+ repo: "nix-template" . to_string( )
319+ } ) ) ;
316320 }
317321
318322 #[ test]
You can’t perform that action at this time.
0 commit comments