Hello community, here is the log from the commit of package i18nspector for openSUSE:Factory checked in at 2015-03-09 10:10:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/i18nspector (Old) and /work/SRC/openSUSE:Factory/.i18nspector.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "i18nspector" Changes: -------- --- /work/SRC/openSUSE:Factory/i18nspector/i18nspector.changes 2015-02-06 22:38:20.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.i18nspector.new/i18nspector.changes 2015-03-09 10:10:06.000000000 +0100 @@ -1,0 +2,7 @@ +Tue Mar 3 10:03:48 UTC 2015 - [email protected] + +- Update to 0.18.1. + * Make the plural expression parser more robust. + * Improve the test suite. + +------------------------------------------------------------------- Old: ---- i18nspector-0.18.tar.gz i18nspector-0.18.tar.gz.asc New: ---- i18nspector-0.18.1.tar.gz i18nspector-0.18.1.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ i18nspector.spec ++++++ --- /var/tmp/diff_new_pack.SYkxeb/_old 2015-03-09 10:10:06.000000000 +0100 +++ /var/tmp/diff_new_pack.SYkxeb/_new 2015-03-09 10:10:06.000000000 +0100 @@ -17,7 +17,7 @@ Name: i18nspector -Version: 0.18 +Version: 0.18.1 Release: 0 Summary: Tool for Checking gettext POT/PO/MO Files License: MIT ++++++ i18nspector-0.18.tar.gz -> i18nspector-0.18.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/data/languages new/i18nspector-0.18.1/data/languages --- old/i18nspector-0.18/data/languages 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/data/languages 2015-03-02 12:26:02.000000000 +0100 @@ -173,7 +173,7 @@ names = Bengali characters = অ আ ই ঈ উ ঊ ঋ এ ঐ ও ঔ ক খ গ ঘ ঙ চ ছ জ ঝ ঞ ট ঠ ড ঢ ণ ত থ দ ধ ন প ফ ব ভ ম য র ল শ ষ স হ -plural-forms = nplurals=2; plural=n != 1 +plural-forms = nplurals=2; plural=n != 1; principal-territory = IN [bo] @@ -210,7 +210,7 @@ characters = à é è í ï ó ò ú ü ç À É È Í Ï Ó Ò Ú Ü Ç -plural-forms = nplurals=2; plural=n != 1 +plural-forms = nplurals=2; plural=n != 1; principal-territory = ES [ce] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/doc/changelog new/i18nspector-0.18.1/doc/changelog --- old/i18nspector-0.18/doc/changelog 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/doc/changelog 2015-03-02 12:26:02.000000000 +0100 @@ -1,3 +1,10 @@ +i18nspector (0.18.1) unstable; urgency=low + + * Make the plural expression parser more robust. + * Improve the test suite. + + -- Jakub Wilk <[email protected]> Mon, 02 Mar 2015 12:25:43 +0100 + i18nspector (0.18) unstable; urgency=low * Rename --debian as --unpack-deb. Don't make it default even on diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/doc/i18nspector.1 new/i18nspector-0.18.1/doc/i18nspector.1 --- old/i18nspector-0.18/doc/i18nspector.1 2015-01-27 23:25:07.000000000 +0100 +++ new/i18nspector-0.18.1/doc/i18nspector.1 2015-03-02 12:26:04.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH I18NSPECTOR 1 "2015-01-27" "i18nspector 0.18" "" +.TH I18NSPECTOR 1 "2015-03-02" "i18nspector 0.18.1" "" .SH NAME i18nspector \- checking tool for gettext POT, PO and MO files . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/doc/i18nspector.txt new/i18nspector-0.18.1/doc/i18nspector.txt --- old/i18nspector-0.18/doc/i18nspector.txt 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/doc/i18nspector.txt 2015-03-02 12:26:02.000000000 +0100 @@ -7,7 +7,7 @@ ---------------------------------------------- :manual section: 1 -:version: i18nspector 0.18 +:version: i18nspector 0.18.1 :date: |date| Synopsis diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/doc/todo.txt new/i18nspector-0.18.1/doc/todo.txt --- old/i18nspector-0.18/doc/todo.txt 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/doc/todo.txt 2015-03-02 12:26:02.000000000 +0100 @@ -40,6 +40,9 @@ * ``nl (Dutch)``: http://sources.debian.net/data/main/g/garcon/0.1.12-1/po/nl.po * ``Serbian (sr)``: http://sources.debian.net/data/main/a/at-spi2-atk/2.5.3-2/po/sr.po +Unbreak ``private/online-check-poedit-data``: +https://github.com/vslavik/poedit/blob/master/src/language_impl_legacy.h + Guess language from ``Language-Team``. * https://translationproject.org/team/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/lib/cli.py new/i18nspector-0.18.1/lib/cli.py --- old/i18nspector-0.18/lib/cli.py 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/lib/cli.py 2015-03-02 12:26:02.000000000 +0100 @@ -37,7 +37,7 @@ from . import tags from . import terminal -__version__ = '0.18' +__version__ = '0.18.1' def initialize_terminal(): if sys.stdout.isatty(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/lib/gettext.py new/i18nspector-0.18.1/lib/gettext.py --- old/i18nspector-0.18/lib/gettext.py 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/lib/gettext.py 2015-03-02 12:26:02.000000000 +0100 @@ -163,6 +163,8 @@ if len(stack) <= 1: raise PluralExpressionSyntaxError s = _subst_ifelse(stack.pop()) + if ('?' in s) or (':' in s): + raise PluralExpressionSyntaxError stack[-1] += '({})'.format(s) else: stack[-1] += token diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/private/online-check-gettext-data new/i18nspector-0.18.1/private/online-check-gettext-data --- old/i18nspector-0.18/private/online-check-gettext-data 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/private/online-check-gettext-data 2015-03-02 12:26:02.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -# Copyright © 2012, 2013, 2014 Jakub Wilk <[email protected]> +# Copyright © 2012, 2013, 2014, 2015 Jakub Wilk <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -25,11 +25,7 @@ import sys import urllib.request -basedir = os.path.join( - os.path.dirname(__file__), - os.pardir, -) -sys.path[:0] = [basedir] +sys.path[0] += '/..' from lib import gettext from lib import ling diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/private/online-check-poedit-data new/i18nspector-0.18.1/private/online-check-poedit-data --- old/i18nspector-0.18/private/online-check-poedit-data 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/private/online-check-poedit-data 2015-03-02 12:26:02.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -# Copyright © 2012, 2013 Jakub Wilk <[email protected]> +# Copyright © 2012, 2013, 2015 Jakub Wilk <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -25,11 +25,7 @@ import sys import urllib.request -basedir = os.path.join( - os.path.dirname(__file__), - os.pardir, -) -sys.path[:0] = [basedir] +sys.path[0] += '/..' from lib import ling diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/private/tags-as-rst new/i18nspector-0.18.1/private/tags-as-rst --- old/i18nspector-0.18/private/tags-as-rst 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/private/tags-as-rst 2015-03-02 12:26:02.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -# Copyright © 2012, 2013 Jakub Wilk <[email protected]> +# Copyright © 2012, 2013, 2015 Jakub Wilk <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -25,11 +25,7 @@ import re import sys -basedir = os.path.join( - os.path.dirname(__file__), - os.pardir, -) -sys.path[:0] = [basedir] +sys.path[0] += '/..' from lib import tags diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/private/update-charmaps new/i18nspector-0.18.1/private/update-charmaps --- old/i18nspector-0.18/private/update-charmaps 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/private/update-charmaps 2015-03-02 12:26:02.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -# Copyright © 2013 Jakub Wilk <[email protected]> +# Copyright © 2013, 2015 Jakub Wilk <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -23,11 +23,8 @@ import os import sys -basedir = os.path.join( - os.path.dirname(__file__), - os.pardir, -) -sys.path[:0] = [basedir] +sys.path[0] += '/..' +basedir = sys.path[0] from lib import encodings from lib import iconv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/private/update-tag-coverage new/i18nspector-0.18.1/private/update-tag-coverage --- old/i18nspector-0.18/private/update-tag-coverage 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/private/update-tag-coverage 2015-03-02 12:26:02.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -# Copyright © 2012, 2013 Jakub Wilk <[email protected]> +# Copyright © 2012, 2013, 2015 Jakub Wilk <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -23,11 +23,7 @@ import os import sys -basedir = os.path.join( - os.path.dirname(__file__), - os.pardir, -) -sys.path[:0] = [basedir] +sys.path[0] += '/..' from lib import tags from tests import blackbox_tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/private/update-timezones new/i18nspector-0.18.1/private/update-timezones --- old/i18nspector-0.18/private/update-timezones 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/private/update-timezones 2015-03-02 12:26:02.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -# Copyright © 2013 Jakub Wilk <[email protected]> +# Copyright © 2013, 2015 Jakub Wilk <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -28,8 +28,8 @@ import pytz -basedir = '{here}/..'.format(here=os.path.dirname(__file__)) -sys.path[:0] = [basedir] +sys.path[0] += '/..' +basedir = sys.path[0] import lib.gettext as gettext diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/blackbox_tests/__init__.py new/i18nspector-0.18.1/tests/blackbox_tests/__init__.py --- old/i18nspector-0.18/tests/blackbox_tests/__init__.py 2015-01-27 23:25:05.000000000 +0100 +++ new/i18nspector-0.18.1/tests/blackbox_tests/__init__.py 2015-03-02 12:26:02.000000000 +0100 @@ -1,4 +1,4 @@ -# Copyright © 2012, 2013, 2014 Jakub Wilk <[email protected]> +# Copyright © 2012, 2013, 2014, 2015 Jakub Wilk <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/mo-parser/run new/i18nspector-0.18.1/tests/fuzzing/mo-parser/run --- old/i18nspector-0.18/tests/fuzzing/mo-parser/run 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/mo-parser/run 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1,36 @@ +#!/bin/sh + +# Copyright © 2015 Jakub Wilk <[email protected]> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the “Software”), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +set -e +here=$(dirname "$0") +output="$here/output" +if [ -e "$output/" ] +then + input=- +else + input=$(mktemp -d -t i18nspector.fuzzing.XXXXXX) + cp "$here/../../blackbox_tests/"*.mo "$input/" +fi +export AFL_NO_VAR_CHECK=1 +exec py-afl-fuzz -i "$input" -o "$output" -T i18nspector-mo-parser -- python3 "$here/test.py" + +# vim:ts=4 sts=4 sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/mo-parser/test.py new/i18nspector-0.18.1/tests/fuzzing/mo-parser/test.py --- old/i18nspector-0.18/tests/fuzzing/mo-parser/test.py 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/mo-parser/test.py 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1,50 @@ +# Copyright © 2015 Jakub Wilk <[email protected]> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the “Software”), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import os +import sys + +import afl + +sys.path[0] += '/../../..' +sys.path[:0] = [sys.path[0] + '/tests'] + +import aux +import lib.moparser as M + +def parser_for_bytes(data): + with aux.temporary_file(suffix='.mo') as file: + file.write(data) + file.flush() + return M.Parser(file.name) + +def test(data): + try: + parser_for_bytes(data) + except M.SyntaxError: + return + except UnicodeDecodeError: + pass + +afl.start() +data = sys.stdin.buffer.read() +test(data) + +# vim:ts=4 sts=4 sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p1 new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p1 --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p1 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p1 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=1; plural=0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p2b new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p2b --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p2b 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p2b 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=2; plural=n > 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3a new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3a --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3a 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3a 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3b new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3b --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3b 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3b 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3c new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3c --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3c 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3c 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3d new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3d --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3d 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3d 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3e new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3e --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3e 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3e 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3f new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3f --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3f 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3f 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3g new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3g --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p3g 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p3g 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p4a new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p4a --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p4a 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p4a 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p4b new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p4b --- old/i18nspector-0.18/tests/fuzzing/plural-forms/input/p4b 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/input/p4b 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1 @@ +nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/run new/i18nspector-0.18.1/tests/fuzzing/plural-forms/run --- old/i18nspector-0.18/tests/fuzzing/plural-forms/run 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/run 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1,29 @@ +#!/bin/sh + +# Copyright © 2015 Jakub Wilk <[email protected]> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the “Software”), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +set -e +here=$(dirname "$0") +input="$here/input" +output="$here/output" +[ -e "$output/" ] && input=- +export AFL_NO_VAR_CHECK=1 +exec py-afl-fuzz -i "$input" -o "$output" -T i18nspector-plural-forms -- python3 "$here/test.py" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/fuzzing/plural-forms/test.py new/i18nspector-0.18.1/tests/fuzzing/plural-forms/test.py --- old/i18nspector-0.18/tests/fuzzing/plural-forms/test.py 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.18.1/tests/fuzzing/plural-forms/test.py 2015-03-02 12:26:02.000000000 +0100 @@ -0,0 +1,51 @@ +# Copyright © 2015 Jakub Wilk <[email protected]> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the “Software”), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import os +import sys + +import afl + +sys.path[0] += '/../../..' + +from lib import gettext + +def test(s): + try: + (n, expr) = gettext.parse_plural_forms(s) + except gettext.PluralFormsSyntaxError: + return + for i in range(200): + try: + fi = expr(i) + except OverflowError: + return + except ZeroDivisionError: + return + +afl.start() +try: + s = sys.stdin.read() +except UnicodeError: + pass +else: + test(s) + +# vim:ts=4 sts=4 sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/run-tests new/i18nspector-0.18.1/tests/run-tests --- old/i18nspector-0.18/tests/run-tests 2015-01-27 23:25:06.000000000 +0100 +++ new/i18nspector-0.18.1/tests/run-tests 2015-03-02 12:26:02.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -# Copyright © 2013 Jakub Wilk <[email protected]> +# Copyright © 2013, 2015 Jakub Wilk <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -25,7 +25,7 @@ import nose -sys.path[0] = os.path.join(os.path.dirname(__file__), '..') +sys.path[0] += '/..' from tests import blackbox_tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.18/tests/test_gettext.py new/i18nspector-0.18.1/tests/test_gettext.py --- old/i18nspector-0.18/tests/test_gettext.py 2015-01-27 23:25:06.000000000 +0100 +++ new/i18nspector-0.18.1/tests/test_gettext.py 2015-03-02 12:26:02.000000000 +0100 @@ -227,6 +227,10 @@ def test_nested_conditional(self): self.t('(2 ? 3 : 7) ? 23 : 37') + def test_badly_nested_conditional(self): + with assert_raises(self.error): + self.t('2 ? (3 : 7 ? ) : 23') + def test_unary_plus(self): with assert_raises(self.error): self.t('-37') -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
