Skip to content

Commit

Permalink
dot-dsl: Remove dependency in test code (#1989)
Browse files Browse the repository at this point in the history
[no important files changed]
  • Loading branch information
senekor authored Aug 25, 2024
1 parent 2303acb commit ed9efec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions exercises/practice/dot-dsl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ edition = "2021"
name = "dot-dsl"
version = "0.1.0"

[dependencies]
maplit = "1.0.1"
[lints.clippy]
new_without_default = "allow"
17 changes: 8 additions & 9 deletions exercises/practice/dot-dsl/tests/dot-dsl.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use std::collections::HashMap;

use dot_dsl::graph::graph_items::edge::Edge;
use dot_dsl::graph::graph_items::node::Node;
use dot_dsl::graph::Graph;
use maplit::hashmap;

#[test]
fn empty_graph() {
Expand Down Expand Up @@ -81,9 +82,7 @@ fn graph_with_one_edge_with_keywords() {
fn graph_with_one_attribute() {
let graph = Graph::new().with_attrs(&[("foo", "1")]);

let expected_attrs = hashmap! {
"foo".to_string() => "1".to_string(),
};
let expected_attrs = HashMap::from([("foo".to_string(), "1".to_string())]);

assert!(graph.nodes.is_empty());

Expand All @@ -108,11 +107,11 @@ fn graph_with_attributes() {

let attrs = vec![("foo", "1"), ("title", "Testing Attrs"), ("bar", "true")];

let expected_attrs = hashmap! {
"foo".to_string() => "1".to_string(),
"title".to_string() => "Testing Attrs".to_string(),
"bar".to_string() => "true".to_string(),
};
let expected_attrs = HashMap::from([
("foo".to_string(), "1".to_string()),
("title".to_string(), "Testing Attrs".to_string()),
("bar".to_string(), "true".to_string()),
]);

let graph = Graph::new()
.with_nodes(&nodes)
Expand Down

0 comments on commit ed9efec

Please sign in to comment.