pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/R2pkg pkgtools/R2pkg: update to 0.6.3



details:   https://anonhg.NetBSD.org/pkgsrc/rev/352fceba80f0
branches:  trunk
changeset: 342473:352fceba80f0
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Oct 19 15:47:03 2019 +0000

description:
pkgtools/R2pkg: update to 0.6.3

Changes since 0.6.1:

* Fix comparison of articles (a, an) in comments.

diffstat:

 pkgtools/R2pkg/Makefile           |   4 ++--
 pkgtools/R2pkg/files/R2pkg.R      |   8 ++------
 pkgtools/R2pkg/files/R2pkg_test.R |  27 +++++++++++++--------------
 pkgtools/R2pkg/files/RELEASE      |  11 +++++++++--
 4 files changed, 26 insertions(+), 24 deletions(-)

diffs (112 lines):

diff -r d956974d6857 -r 352fceba80f0 pkgtools/R2pkg/Makefile
--- a/pkgtools/R2pkg/Makefile   Sat Oct 19 14:52:40 2019 +0000
+++ b/pkgtools/R2pkg/Makefile   Sat Oct 19 15:47:03 2019 +0000
@@ -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 -r d956974d6857 -r 352fceba80f0 pkgtools/R2pkg/files/R2pkg.R
--- a/pkgtools/R2pkg/files/R2pkg.R      Sat Oct 19 14:52:40 2019 +0000
+++ b/pkgtools/R2pkg/files/R2pkg.R      Sat Oct 19 15:47:03 2019 +0000
@@ -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 @@
 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 -r d956974d6857 -r 352fceba80f0 pkgtools/R2pkg/files/R2pkg_test.R
--- a/pkgtools/R2pkg/files/R2pkg_test.R Sat Oct 19 14:52:40 2019 +0000
+++ b/pkgtools/R2pkg/files/R2pkg_test.R Sat Oct 19 15:47:03 2019 +0000
@@ -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 @@
         '\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.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 -r d956974d6857 -r 352fceba80f0 pkgtools/R2pkg/files/RELEASE
--- a/pkgtools/R2pkg/files/RELEASE      Sat Oct 19 14:52:40 2019 +0000
+++ b/pkgtools/R2pkg/files/RELEASE      Sat Oct 19 15:47:03 2019 +0000
@@ -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 @@
 * 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 @@
 * 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.



Home | Main Index | Thread Index | Old Index