Skip to content

Commit

Permalink
dot-dsl: remove dependency in test code
Browse files Browse the repository at this point in the history
  • Loading branch information
senekor committed Aug 25, 2024
1 parent d47d407 commit a832fc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
3 changes: 0 additions & 3 deletions exercises/practice/dot-dsl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
edition = "2021"
name = "dot-dsl"
version = "0.1.0"

[dependencies]
maplit = "1.0.1"
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 a832fc5

Please sign in to comment.