From 373fbfd822be53d76c861118d5fa60300d223d6b Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 7 Sep 2020 18:51:54 -0600 Subject: refactor: inline variable declarations --- src/03/graph_test.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/03/graph_test.c b/src/03/graph_test.c index fd025a5..7a04a5b 100644 --- a/src/03/graph_test.c +++ b/src/03/graph_test.c @@ -35,13 +35,15 @@ Ensure(add_vertex_adds_max_number_of_verticies_to_graph) { Ensure(add_edge_connects_two_vertices) { Graph *graph = graph_initialize(); - Vertex *a = graph_add_vertex(graph, 'a'); - Vertex *b = graph_add_vertex(graph, 'b'); - graph_add_edge(graph, a, b); + graph_add_edge( + graph, + graph_add_vertex(graph, 'a'), + graph_add_vertex(graph, 'b') + ); - assert_that(graph->edges[a->label][b->label], is_equal_to(true)); - assert_that(graph->edges[b->label][a->label], is_equal_to(false)); + assert_that(graph->edges['a']['b'], is_equal_to(true)); + assert_that(graph->edges['b']['a'], is_equal_to(false)); } TestSuite *graph_tests() { -- cgit v1.2.3