From 451f437fcb2a7394bcd691ce82d677147a791284 Mon Sep 17 00:00:00 2001 From: Peter van 't Hof <p.j.van_t_hof@lumc.nl> Date: Wed, 26 Aug 2015 19:23:42 +0200 Subject: [PATCH] Adding method to test scatter --- .../biopet/utils/intervals/BedRecordTest.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/utils/intervals/BedRecordTest.scala b/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/utils/intervals/BedRecordTest.scala index 4104e71d9..4bc400829 100644 --- a/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/utils/intervals/BedRecordTest.scala +++ b/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/utils/intervals/BedRecordTest.scala @@ -127,6 +127,20 @@ class BedRecordTest extends TestNGSuite with Matchers { level2.originals(nested = false) shouldBe List(level1) } + @Test def testScatter: Unit = { + val list = BedRecord("chrQ", 0, 1000).scatter(10) + list.size shouldBe 100 + BedRecordList.fromList(list).length shouldBe 1000 + + val list2 = BedRecord("chrQ", 0, 999).scatter(10) + list2.size shouldBe 99 + BedRecordList.fromList(list2).length shouldBe 999 + + val list3 = BedRecord("chrQ", 0, 999).scatter(9) + list3.size shouldBe 111 + BedRecordList.fromList(list3).length shouldBe 999 + } + @Test def testErrors: Unit = { BedRecord("chrQ", 0, 3).validate BedRecord.fromLine("chrQ\t0\t100\tname\t3\t+\t1\t3\t255,0,0\t2\t10,20\t20,50").validate -- GitLab