[Roxygen-commits] r69 - in pkg: . R tests tests/collate

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jul 21 04:35:35 CEST 2008


Author: pcd
Date: 2008-07-21 04:35:33 +0200 (Mon, 21 Jul 2008)
New Revision: 69

Added:
   pkg/tests/
   pkg/tests/Rd.R
   pkg/tests/collate/
   pkg/tests/collate/belt.R
   pkg/tests/collate/jacket.R
   pkg/tests/collate/pants.R
   pkg/tests/collate/shirt.R
   pkg/tests/collate/shoes.R
   pkg/tests/collate/socks.R
   pkg/tests/collate/tie.R
   pkg/tests/collate/undershorts.R
   pkg/tests/collate/watch.R
   pkg/tests/main.R
   pkg/tests/namespace.R
   pkg/tests/tests.R
Modified:
   pkg/R/Rd.R
Log:
fix abweichende roxygen-Rd relationships; tests


Modified: pkg/R/Rd.R
===================================================================
--- pkg/R/Rd.R	2008-07-20 23:23:16 UTC (rev 68)
+++ pkg/R/Rd.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -25,7 +25,6 @@
   roclet$register.default.parsers('name',
                                   'title',
                                   'usage',
-                                  'value',
                                   'references',
                                   'note',
                                   'author',
@@ -33,6 +32,10 @@
                                   'examples',
                                   'concept')
 
+  roclet$register.parser('return',
+                         function(key, expressions)
+                         parse.expression('value', expressions))
+
   parse.split <- function(key, expressions) {
     expression <- strcar(expressions)
     rest <- strcdr(expressions)
@@ -41,10 +44,14 @@
       parse.split(key, rest)
   }
 
-  roclet$register.parsers(parse.split,
-                          'keyword',
-                          'alias')
+  roclet$register.parser('aliases',
+                         function(key, expressions)
+                         parse.split('alias', expressions))
 
+  roclet$register.parser('keywords',
+                         function(key, expressions)
+                         parse.split('keyword', expressions))
+
   parse.description <- function(key, expressions) {
     paragraphs <- car(strsplit(car(expressions), '\n\n', fixed=T))
     description <- car(paragraphs)

Added: pkg/tests/Rd.R
===================================================================
--- pkg/tests/Rd.R	                        (rev 0)
+++ pkg/tests/Rd.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1,19 @@
+#' description
+#'
+#' details
+#' @name test
+#' @title test
+#' @usage test
+#' @return test
+#' @references test
+#' @note test
+#' @author test@@example.com
+#' @seealso test
+#' @examples test
+#' @concept test
+#' @keywords test1 test2
+#' @aliases test1 test2
+#' @param p1 first param
+#' @param p2 second param
+#' @param p3 third param
+roxygen()

Added: pkg/tests/collate/belt.R
===================================================================
--- pkg/tests/collate/belt.R	                        (rev 0)
+++ pkg/tests/collate/belt.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1,3 @@
+#' @include collate/pants.R
+#' @include collate/shirt.R
+roxygen()

Added: pkg/tests/collate/jacket.R
===================================================================
--- pkg/tests/collate/jacket.R	                        (rev 0)
+++ pkg/tests/collate/jacket.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1,3 @@
+#' @include collate/tie.R
+#' @include collate/belt.R
+roxygen()

Added: pkg/tests/collate/pants.R
===================================================================
--- pkg/tests/collate/pants.R	                        (rev 0)
+++ pkg/tests/collate/pants.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1,2 @@
+#' @include collate/undershorts.R
+roxygen()

Added: pkg/tests/collate/shirt.R
===================================================================
--- pkg/tests/collate/shirt.R	                        (rev 0)
+++ pkg/tests/collate/shirt.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1 @@
+roxygen()

Added: pkg/tests/collate/shoes.R
===================================================================
--- pkg/tests/collate/shoes.R	                        (rev 0)
+++ pkg/tests/collate/shoes.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1,4 @@
+#' @include collate/socks.R
+#' @include collate/undershorts.R
+#' @include collate/pants.R
+roxygen()

Added: pkg/tests/collate/socks.R
===================================================================
--- pkg/tests/collate/socks.R	                        (rev 0)
+++ pkg/tests/collate/socks.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1 @@
+roxygen()

Added: pkg/tests/collate/tie.R
===================================================================
--- pkg/tests/collate/tie.R	                        (rev 0)
+++ pkg/tests/collate/tie.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1,2 @@
+#' @include collate/shirt.R
+roxygen()

Added: pkg/tests/collate/undershorts.R
===================================================================
--- pkg/tests/collate/undershorts.R	                        (rev 0)
+++ pkg/tests/collate/undershorts.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1 @@
+roxygen()

Added: pkg/tests/collate/watch.R
===================================================================
--- pkg/tests/collate/watch.R	                        (rev 0)
+++ pkg/tests/collate/watch.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1 @@
+roxygen()

Added: pkg/tests/main.R
===================================================================
--- pkg/tests/main.R	                        (rev 0)
+++ pkg/tests/main.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1,12 @@
+library(RUnit)
+
+source('../R/functional.R')
+source('../R/list.R')
+source('../R/string.R')
+source('../R/parse.R')
+source('../R/roclet.R')
+source('../R/collate.R')
+source('../R/namespace.R')
+source('../R/Rd.R')
+
+runTestFile('tests.R')

Added: pkg/tests/namespace.R
===================================================================
--- pkg/tests/namespace.R	                        (rev 0)
+++ pkg/tests/namespace.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1,10 @@
+#' @exportClass test
+#' @exportMethod  test
+#' @export test
+#' @exportPattern test
+#' @S3method test
+#' @import test
+#' @importFrom test
+#' @importClassesFrom test
+#' @importMethodsFrom test
+roxygen()

Added: pkg/tests/tests.R
===================================================================
--- pkg/tests/tests.R	                        (rev 0)
+++ pkg/tests/tests.R	2008-07-21 02:35:33 UTC (rev 69)
@@ -0,0 +1,54 @@
+test.namespace <- function() {
+  roclet <- make.namespace.roclet()
+  checkEquals(capture.output(roclet$parse('namespace.R')),
+              c('exportClasses(test)',
+                'exportMethods(test)',
+                'export(test)',
+                'exportPattern(test)',
+                'S3method(test)',
+                'import(test)',
+                'importFrom(test)',
+                'importClassesFrom(test)',
+                'importMethodsFrom(test)'))
+}
+
+test.Rd <- function() {
+  roclet <- make.Rd.roclet()
+  checkEquals(capture.output(roclet$parse('Rd.R')),
+              c('\\description{description}',
+                '\\details{details}',
+                '\\name{test}',
+                '\\title{test}',
+                '\\usage{test}',
+                '\\value{test}',
+                '\\references{test}',
+                '\\note{test}',
+                '\\author{test at example.com}',
+                '\\seealso{test}',
+                '\\examples{test}',
+                '\\concept{test}',
+                '\\keyword{test1}',
+                '\\keyword{test2}',
+                '\\alias{test1}',
+                '\\alias{test2}',
+                '\\arguments{\\item{p1}{first param}',
+                '\\item{p2}{second param}',
+                '\\item{p3}{third param}}'))
+}
+
+test.collate <- function() {
+  roclet <- make.collate.roclet()
+  checkEquals(capture.output(roclet$parse('collate/belt.R',
+                                          'collate/jacket.R',
+                                          'collate/pants.R',
+                                          'collate/shirt.R',
+                                          'collate/shoes.R',
+                                          'collate/socks.R',
+                                          'collate/tie.R',
+                                          'collate/undershorts.R',
+                                          'collate/watch.R')),
+              paste('collate collate/undershorts.R collate/pants.R',
+                    'collate/belt.R collate/shirt.R collate/tie.R',
+                    'collate/jacket.R collate/socks.R collate/shoes.R',
+                    'collate/watch.R'))
+}



More information about the Roxygen-commits mailing list