diff --git a/tests/bandagetests.cpp b/tests/bandagetests.cpp index 564e1434..37a620b5 100644 --- a/tests/bandagetests.cpp +++ b/tests/bandagetests.cpp @@ -106,6 +106,7 @@ private slots: void loadGFA(); void loadGAF(); void loadSPAdesPaths(); + void loadLinks(); void loadTrinity(); void pathFunctionsOnGFA(); void pathFunctionsOnFastg(); @@ -256,6 +257,27 @@ void BandageTests::loadSPAdesPaths() QCOMPARE(p22.getLength(), 6000); } +void BandageTests::loadLinks() +{ + // Check that the graph loaded properly. + QVERIFY(g_assemblyGraph->loadGraphFromFile(testFile("test.gfa"))); + + // Check that the appropriate number of nodes/edges are present. + QCOMPARE(g_assemblyGraph->m_deBruijnGraphNodes.size(), 34); + QCOMPARE(g_assemblyGraph->m_deBruijnGraphEdges.size(), 32); + + // Check the length of a couple nodes. + DeBruijnNode * node1 = g_assemblyGraph->m_deBruijnGraphNodes["1+"]; + DeBruijnNode * node14 = g_assemblyGraph->m_deBruijnGraphNodes["14-"]; + QCOMPARE(node1->getLength(), 2060); + QCOMPARE(node14->getLength(), 120); + + std::vector newEdges; + QVERIFY(io::loadLinks(*g_assemblyGraph, testFile("test.links.tsv"), &newEdges)); + QCOMPARE(newEdges.size(), 4); + QCOMPARE(g_assemblyGraph->m_deBruijnGraphEdges.size(), 36); +} + void BandageTests::loadTrinity() { diff --git a/tests/inputs/test.links.tsv b/tests/inputs/test.links.tsv new file mode 100644 index 00000000..bc58dc88 --- /dev/null +++ b/tests/inputs/test.links.tsv @@ -0,0 +1,2 @@ +13 2 42 +15 7 10 CB:Z:yellow