From 3548167a8377fd2448656f28a731316f2d9dfb70 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sat, 26 Jan 2008 18:48:09 +0000 Subject: [PATCH] Changed the testGraph function in FlowGraphTest to add a variant that takes an A.Structured directly --- common/FlowGraphTest.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/FlowGraphTest.hs b/common/FlowGraphTest.hs index c717938..4bbf39e 100644 --- a/common/FlowGraphTest.hs +++ b/common/FlowGraphTest.hs @@ -104,9 +104,12 @@ nextId' inc t -- for being isomorphic, based on the meta-tag node labels (node E in the expected list is -- isomorphic to node A in the actual list if their meta tags are the same). testGraph :: String -> [(Int, Meta)] -> [(Int, Int, EdgeLabel)] -> A.Process -> Test -testGraph testName nodes edges proc +testGraph testName nodes edges proc = testGraph' testName nodes edges (A.OnlyP emptyMeta proc) + +testGraph' :: String -> [(Int, Meta)] -> [(Int, Int, EdgeLabel)] -> A.Structured -> Test +testGraph' testName nodes edges code = TestCase $ - case evalState (buildFlowGraph testOps (A.OnlyP emptyMeta proc)) Map.empty of + case evalState (buildFlowGraph testOps code) Map.empty of Left err -> assertFailure (testName ++ " graph building failed: " ++ err) Right g -> checkGraphEquality (nodes, edges) (g :: FlowGraph Identity Int) where