MCPcopy Create free account
hub / github.com/LFYSec/MScan / readGraph

Method readGraph

src/test/java/pascal/taie/util/graph/GraphTest.java:144–158  ·  view source on GitHub ↗
(String filePath)

Source from the content-addressed store, hash-verified

142 }
143
144 private static SimpleGraph<Integer> readGraph(String filePath) {
145 SimpleGraph<Integer> graph = new SimpleGraph<>();
146 try {
147 Files.readAllLines(Path.of(filePath)).forEach(line -> {
148 String[] split = line.split("->");
149 int source = Integer.parseInt(split[0]);
150 int target = Integer.parseInt(split[1]);
151 graph.addEdge(source, target);
152 });
153 } catch (IOException e) {
154 throw new RuntimeException("Failed to read " + filePath +
155 " due to " + e);
156 }
157 return graph;
158 }
159}

Callers 7

testSimpleGraphMethod · 0.95
testSimpleGraphCopyMethod · 0.95
testSimpleGraphRemoveMethod · 0.95
testTopsortMethod · 0.95
testSCCMethod · 0.95
testMergedSCCMethod · 0.95
testDominatorMethod · 0.95

Calls 3

addEdgeMethod · 0.95
forEachMethod · 0.65
ofMethod · 0.65

Tested by

no test coverage detected