Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-16 - Add unit tests #112

Merged
merged 1 commit into from
Sep 9, 2020

Conversation

jmcconnell26
Copy link
Contributor

Add unit testing to several of the newly refactored modules, ahead of
migrating to use cargo_metadata

Unit tests added to:

  • cli
  • format - print
  • format - table
  • format - tree
  • format
  • graph
  • rs_file
  • scan
  • traversal

Add unit testing to several of the newly refactored modules, ahead of
migrating to use cargo_metadata

Unit tests added to:
* cli
* format - print
* format - table
* format - tree
* format
* graph
* rs_file
* scan
* traversal
Copy link
Contributor

@anderejd anderejd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great refactoring 🥇 Looks good to me!

@@ -152,27 +167,66 @@ pub fn print_text_tree_lines_as_table(
let name = name.unwrap();

// TODO: Fix the alignment on macOS (others too?)
println!("{}{}{}", table_row_empty(), tree_vines, name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This change was long overdue :)

@@ -8,20 +8,21 @@ use cargo::core::PackageId;
pub enum TextTreeLine {
/// A text line for a package
Package { id: PackageId, tree_vines: String },
/// There're extra dependencies comming and we should print a group header,
/// There are extra dependencies coming and we should print a group header,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +154 to +160
add_graph_node_if_not_present_and_edge(
dependency,
dependency_package_id,
graph,
index,
pending_packages,
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup!

@anderejd anderejd merged commit 4113000 into geiger-rs:master Sep 9, 2020
@jmcconnell26
Copy link
Contributor Author

Awesome! Thanks for the review!

@jmcconnell26 jmcconnell26 deleted the ISSUE-16-AddUnitTests branch September 28, 2020 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants