Skip to content

Commit 474ee11

Browse files
committed
Fix tests
1 parent efa9bd8 commit 474ee11

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/types/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ arg_enum! {
6060
}
6161
}
6262

63-
#[derive(Debug)]
63+
#[derive(Debug, PartialEq)]
6464
pub enum Repo {
6565
Pypi(PypiRepo),
6666
Github(GithubRepo),
6767
}
6868

69-
#[derive(Debug)]
69+
#[derive(Debug, PartialEq)]
7070
pub struct PypiRepo {
7171
pub project: String,
7272
}
7373

74-
#[derive(Debug)]
74+
#[derive(Debug, PartialEq)]
7575
pub struct GithubRepo {
7676
pub owner: String,
7777
pub repo: String,

src/url.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ pub fn read_meta_from_url(url: &str, info: &mut types::ExpressionInfo) {
302302
mod 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]

0 commit comments

Comments
 (0)