SCM

SCM Repository

[inlinedocs] Diff of /pkg/inlinedocs/R/test.R
ViewVC logotype

Diff of /pkg/inlinedocs/R/test.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 113, Fri Jun 18 09:40:30 2010 UTC revision 138, Tue Oct 19 22:51:59 2010 UTC
# Line 18  Line 18 
18    .result <- e$.result    .result <- e$.result
19    for(FUN in names(.result)){    for(FUN in names(.result)){
20      if(verbose)cat(FUN,"")      if(verbose)cat(FUN,"")
21      for(N in names(.result[[FUN]])){      fun <- result[[FUN]]
22        .res <- .result[[FUN]][[N]]      .fun <- .result[[FUN]]
23        res <- result[[FUN]][[N]]      ## first check to make sure all the stored items are there
24        if(is.null(res) || .res!=res){      for(N in names(.fun)){
25          .res <- .fun[[N]]
26          res <- fun[[N]]
27          if(is.null(res) || is.na(res) || is.na(.res) || .res!=res){
28          stop(f,":\n\n",res,"\nin ",FUN,"$",N,", expected:\n\n",.res,"\n")          stop(f,":\n\n",res,"\nin ",FUN,"$",N,", expected:\n\n",.res,"\n")
29        }        }
30      }      }
31        ## now check and see if there are no additional items!
32        additional <- !names(fun)%in%names(.fun)
33        show <- fun[additional] ##ignore NULL extracted items
34        show <- show[!sapply(show,is.null)]
35        if(length(show)){
36          cat("\n")
37          print(show)
38          stop("extracted some unexpected docs!")
39        }
40    }    }
41    if(verbose)cat("\n")    if(verbose)cat("\n")
42  }  }
# Line 35  Line 47 
47  ### R code file with inlinedocs to process with extract.docs.file.  ### R code file with inlinedocs to process with extract.docs.file.
48   ){   ){
49    .result <- extract.docs.file(f)    .result <- extract.docs.file(f)
50    dump(".result",control=NULL)    dump(".result",tmp <- tempfile(),control=NULL)
51    lines <- readLines("dumpdata.R")    lines <- readLines(tmp)
52    cat(paste(lines,"\n"))    cat(paste(lines,"\n"))
53  }  }

Legend:
Removed from v.113  
changed lines
  Added in v.138

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge