summaryrefslogtreecommitdiffstats
path: root/tests/lint_tests/test_lint_dctrl.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lint_tests/test_lint_dctrl.py')
-rw-r--r--tests/lint_tests/test_lint_dctrl.py69
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/lint_tests/test_lint_dctrl.py b/tests/lint_tests/test_lint_dctrl.py
index 80d7525..229acc1 100644
--- a/tests/lint_tests/test_lint_dctrl.py
+++ b/tests/lint_tests/test_lint_dctrl.py
@@ -1209,3 +1209,72 @@ def test_dctrl_lint_dep_field_restricted_or_relations(
assert problem_text == "|"
assert f"{issue.range}" == "13:1-13:2"
assert issue.severity == DiagnosticSeverity.Error
+
+
+def test_dctrl_duplicate_key(line_linter: LintWrapper) -> None:
+ lines = textwrap.dedent(
+ f"""\
+ Source: jquery-tablesorter
+ Section: javascript
+ Priority: optional
+ Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.de\
+ bian.org>
+ Uploaders: Paul Gevers <elbrus@debian.org>
+ Build-Depends:
+ debhelper-compat (=13),
+ grunt,
+ libjs-qunit,
+ node-grunt-contrib-clean,
+ node-grunt-contrib-copy,
+ node-grunt-contrib-uglify,
+ node-grunt-contrib-concat,
+ Standards-Version: {CURRENT_STANDARDS_VERSION}
+ Homepage: https://github.com/Mottie/tablesorter
+ Vcs-Git: https://salsa.debian.org/js-team/jquery-tablesorter.git
+ Vcs-Browser: https://salsa.debian.org/js-team/jquery-tablesorter
+ Rules-Requires-Root: no
+
+ Package: libjs-jquery-tablesorter
+ Architecture: all
+ Multi-Arch: foreign
+ Depends:
+ ${{misc:Depends}},
+ libjs-jquery,
+ libjs-jquery-metadata,
+ Recommends: javascript-common
+ Multi-Arch: foreign
+ Description: jQuery flexible client-side table sorting plugin
+ Tablesorter is a jQuery plugin for turning a standard HTML table with THEAD
+ and TBODY tags into a sortable table without page refreshes. Tablesorter can
+ successfully parse and sort many types of data including linked data in a
+ cell. It has many useful features including:
+ .
+ * Multi-column alphanumeric sorting and filtering.
+ * Multi-tbody sorting
+ * Supports Bootstrap v2-4.
+ * Parsers for sorting text, alphanumeric text, URIs, integers, currency,
+ floats, IP addresses, dates (ISO, long and short formats) and time.
+ Add your own easily.
+ * Inline editing
+ * Support for ROWSPAN and COLSPAN on TH elements.
+ * Support secondary "hidden" sorting (e.g., maintain alphabetical sort when
+ sorting on other criteria).
+ * Extensibility via widget system.
+ * Cross-browser: IE 6.0+, FF 2+, Safari 2.0+, Opera 9.0+, Chrome 5.0+.
+
+ """
+ ).splitlines(keepends=True)
+
+ diagnostics = line_linter(lines)
+ assert len(diagnostics) == 1
+
+ issue = diagnostics[0]
+
+ msg = (
+ "The Multi-Arch field name was used multiple times in this stanza."
+ " Please ensure the field is only used once per stanza. Note that Multi-Arch and"
+ " X[BCS]-Multi-Arch are considered the same field."
+ )
+ assert issue.message == msg
+ assert f"{issue.range}" == "27:0-27:10"
+ assert issue.severity == DiagnosticSeverity.Error