diff options
author | rillig <rillig@pkgsrc.org> | 2019-10-19 15:47:03 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2019-10-19 15:47:03 +0000 |
commit | d54a401e31aa42d7efc02b8f88423f5855333d87 (patch) | |
tree | 8039d8de19082ced26a58585ab0c0bb9c18d120d /pkgtools | |
parent | db0befb71075f37beb6e1ae7a9b95a71aa6eafcb (diff) | |
download | pkgsrc-d54a401e31aa42d7efc02b8f88423f5855333d87.tar.gz |
pkgtools/R2pkg: update to 0.6.3
Changes since 0.6.1:
* Fix comparison of articles (a, an) in comments.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/R2pkg/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/R2pkg/files/R2pkg.R | 8 | ||||
-rw-r--r-- | pkgtools/R2pkg/files/R2pkg_test.R | 27 | ||||
-rw-r--r-- | pkgtools/R2pkg/files/RELEASE | 11 |
4 files changed, 26 insertions, 24 deletions
diff --git a/pkgtools/R2pkg/Makefile b/pkgtools/R2pkg/Makefile index 8e9d627f527..46371bb3ab5 100644 --- a/pkgtools/R2pkg/Makefile +++ b/pkgtools/R2pkg/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.9 2019/10/13 19:13:47 rillig Exp $ +# $NetBSD: Makefile,v 1.10 2019/10/19 15:47:03 rillig Exp $ # -VERS= 0.6.2 +VERS= 0.6.3 PKGNAME= R2pkg-${VERS} CATEGORIES= pkgtools diff --git a/pkgtools/R2pkg/files/R2pkg.R b/pkgtools/R2pkg/files/R2pkg.R index f6845aadd7f..8d776e8f9ac 100644 --- a/pkgtools/R2pkg/files/R2pkg.R +++ b/pkgtools/R2pkg/files/R2pkg.R @@ -1,4 +1,4 @@ -# $NetBSD: R2pkg.R,v 1.19 2019/10/19 14:52:40 rillig Exp $ +# $NetBSD: R2pkg.R,v 1.20 2019/10/19 15:47:03 rillig Exp $ # # Copyright (c) 2014,2015,2016,2017,2018,2019 # Brook Milligan. All rights reserved. @@ -336,11 +336,7 @@ read.file.as.values <- function(filename) simplify.whitespace <- function(s) gsub('[[:blank:]]+', ' ', s) remove.punctuation <- function(s) gsub('[,-]', '', s) remove.quotes <- function(s) gsub('[\'`"]', '', s) -remove.articles <- function(s) -{ - pattern <- '^([[:blank:]]*)An* |([[:blank:]]+)[Aa]n*[[:blank:]]+' - gsub(pattern,'\\1',s) -} +remove.articles <- function(s) gsub('\\b[Aa]n?\\b', '\\1', s) case.insensitive.equals <- function(s1,s2) { diff --git a/pkgtools/R2pkg/files/R2pkg_test.R b/pkgtools/R2pkg/files/R2pkg_test.R index baeac1ca05b..a92d2a455af 100644 --- a/pkgtools/R2pkg/files/R2pkg_test.R +++ b/pkgtools/R2pkg/files/R2pkg_test.R @@ -1,4 +1,4 @@ -# $NetBSD: R2pkg_test.R,v 1.14 2019/10/19 14:52:40 rillig Exp $ +# $NetBSD: R2pkg_test.R,v 1.15 2019/10/19 15:47:03 rillig Exp $ # # Copyright (c) 2019 # Roland Illig. All rights reserved. @@ -204,14 +204,13 @@ test_that('fix.continued.lines', { '\tvalue', 'VAR2=\tvalue') - expect_printed( - data.frame(varassign = mklines$key_value, line = mklines$line), - ' varassign line', - '1 FALSE # comment \\\\', - '2 TRUE continued=comment', # FIXME: continuation from line 1 - '3 TRUE VAR1=', - '4 TRUE VAR1+=\\tvalue', # FIXME: extra space at the beginning - '5 TRUE VAR2=\\tvalue') + expect_equal(mklines$key_value, c(FALSE, TRUE, TRUE, TRUE, TRUE)) + expect_equal(mklines$line, c( + '# comment \\', + 'continued=comment', # FIXME: continuation from line 1 + 'VAR1=', + 'VAR1+=\tvalue', # FIXME: extra space at the beginning + 'VAR2=\tvalue')) message$expect_messages( '[ 321 ] WARNING: unhandled continued line(s)') }) @@ -335,11 +334,11 @@ test_that('remove.quotes', { }) test_that('remove.articles', { - expect_equal(remove.articles('Get a life'), 'Getlife') # FIXME - expect_equal(remove.articles('An apple a day'), 'appleday') # FIXME - expect_equal(remove.articles('Annnnnnnnnn apple'), 'apple') # FIXME - expect_equal(remove.articles('Grade A'), 'Grade A') - expect_equal(remove.articles('Grade A is best'), 'Gradeis best') # FIXME + expect_equal(remove.articles('Get a life'), 'Get life') + expect_equal(remove.articles('An apple a day'), ' apple day') # TODO: uppercase the first letter + expect_equal(remove.articles('Annnnnnnnnn apple'), 'Annnnnnnnnn apple') + expect_equal(remove.articles('Grade A'), 'Grade ') + expect_equal(remove.articles('Grade A is best'), 'Grade is best') }) test_that('case.insensitive.equals', { diff --git a/pkgtools/R2pkg/files/RELEASE b/pkgtools/R2pkg/files/RELEASE index 1de56b4db9d..30e00db9fdc 100644 --- a/pkgtools/R2pkg/files/RELEASE +++ b/pkgtools/R2pkg/files/RELEASE @@ -1,4 +1,4 @@ -$NetBSD: RELEASE,v 1.5 2019/10/13 13:26:22 rillig Exp $ +$NetBSD: RELEASE,v 1.6 2019/10/19 15:47:03 rillig Exp $ RELEASE ======= @@ -54,7 +54,7 @@ R2pkg v.0.6 (2019-08-08) * Annotate generated comments with [R2pkg] to make them easier to find. R2pkg v.0.6.1 (2019-10-13) ------------------------- +-------------------------- * Run properly even if TMPDIR is not set. @@ -63,3 +63,10 @@ R2pkg v.0.6.1 (2019-10-13) * Write error messages to stderr instead of stdout. * Separate R source code from shell code. + +R2pkg v0.6.3 (2019-10-19) +------------------------- + +* Fix comparison of articles (a, an) in comments. + +* Lots of refactorings. |