[Genabel-commits] r1242 - pkg/GenABEL/inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 3 14:47:20 CEST 2013


Author: lckarssen
Date: 2013-06-03 14:47:20 +0200 (Mon, 03 Jun 2013)
New Revision: 1242

Modified:
   pkg/GenABEL/inst/unitTests/runit.exports.R
Log:
Added unit test for bug #2664 in GenABEL's export.merlin() function. I couldn't reproduce the bug with GA v1.7-6, but at least with this unit test we should be able to detect it if it appears again in the future. 


Modified: pkg/GenABEL/inst/unitTests/runit.exports.R
===================================================================
--- pkg/GenABEL/inst/unitTests/runit.exports.R	2013-06-03 12:29:37 UTC (rev 1241)
+++ pkg/GenABEL/inst/unitTests/runit.exports.R	2013-06-03 12:47:20 UTC (rev 1242)
@@ -63,6 +63,7 @@
   xN <- read.table(file="tmpNew.dat", head=FALSE, strings=FALSE)
   checkIdentical(xN, xO)
 
+  ## Clean up the files we created
   unlink("tmpOld*")
   unlink("tmpNew*")
 
@@ -84,6 +85,7 @@
     print(checkIdentical(gtBack, gtDta))
   }
 
+  ## Clean up the files we created
   unlink("tmpTrans*")
 }
 
@@ -102,4 +104,30 @@
   xO <- read.table(file="tmpOld.ped", head=FALSE, strings=FALSE)
   xN <- read.table(file="tmpNew.ped", head=FALSE, strings=FALSE)
   checkIdentical(xN, xO)
+
+  ## Clean up the files we created
+  unlink("tmpOld*")
+  unlink("tmpNew*")
 }
+
+
+test.export.merlin.bug2664 <- function() {
+  data(srdta)
+  export.merlin(
+    srdta[1:200, 1:10], dpieceFun="new",
+    mapfile="tmp.s1.map", pedfile="tmp.s1.ped", datafile="tmp.s1.dat",
+    stepids=1
+    )
+  export.merlin(
+    srdta[1:200, 1:10], dpieceFun="new",
+    mapfile="tmp.s10.map", pedfile="tmp.s10.ped", datafile="tmp.s10.dat",
+    stepids=10
+    )
+  x1  <- read.table(file="tmp.s1.ped",  header=FALSE, stringsAsFactors=FALSE)
+  x10 <- read.table(file="tmp.s10.ped", header=FALSE, stringsAsFactors=FALSE)
+  checkIdentical(x1, x10)
+
+  ## Clean up the files we created
+  unlink("tmp.s1.*")
+  unlink("tmp.s10.*")
+}



More information about the Genabel-commits mailing list