From 5a92d4e948b772becaa5d168e580225b082e7dda Mon Sep 17 00:00:00 2001 From: Raja Boujbel Date: Thu, 9 Mar 2023 15:05:58 +0100 Subject: [PATCH] reftest: add more test cases for W59 * Shows the difference of behaviour between 'opam lint' and 'opam lint --check-upstream' * Add test cases for special cases: conf flag, url containing git url --- master_changes.md | 1 + tests/reftests/lint.test | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/master_changes.md b/master_changes.md index aba6d377da7..c2623d782cb 100644 --- a/master_changes.md +++ b/master_changes.md @@ -187,6 +187,7 @@ users) * lint: add E71 test [#5561 @rjbou] * lint: add E72 test [#5561 @rjbou] * lint: add E73 test [#5561 @rjbou] + * lint: add more test cases for E59: special cases (conf, git url), with and without option `--with-check-upstream` [#5561 @rjbou] ### Engine * Add a test filtering mechanism [#6105 @Keryan-dev] diff --git a/tests/reftests/lint.test b/tests/reftests/lint.test index c8ac4ac4991..35d2e56bd03 100644 --- a/tests/reftests/lint.test +++ b/tests/reftests/lint.test @@ -851,9 +851,48 @@ license: "ISC" dev-repo: "hg+https://to@li.nt" bug-reports: "https://nobug" url { src:"an-archive.tgz" } +### opam lint ./lint.opam +${BASEDIR}/lint.opam: Passed. ### opam lint ./lint.opam --check-upstream ${BASEDIR}/lint.opam: Warnings. warning 59: url doesn't contain a checksum +### +opam-version: "2.0" +synopsis: "A word" +description: "Two words." +authors: "the testing team" +homepage: "egapemoh" +maintainer: "maint@tain.er" +license: "ISC" +dev-repo: "hg+https://to@li.nt" +bug-reports: "https://nobug" +url { src:"an-archive.tgz" } +flags: conf +### # package with conf flag +### opam lint ./lint.opam +${BASEDIR}/lint.opam: Errors. + error 46: Package is flagged "conf" but has source, install or remove instructions +# Return code 1 # +### opam lint ./lint.opam --check-upstream +${BASEDIR}/lint.opam: Errors. + error 46: Package is flagged "conf" but has source, install or remove instructions +# Return code 1 # +### +opam-version: "2.0" +synopsis: "A word" +description: "Two words." +authors: "the testing team" +homepage: "egapemoh" +maintainer: "maint@tain.er" +license: "ISC" +dev-repo: "hg+https://to@li.nt" +bug-reports: "https://nobug" +url { src:"git+https://a/repo" } +### # package with git url +### opam lint ./lint.opam +${BASEDIR}/lint.opam: Passed. +### opam lint ./lint.opam --check-upstream +${BASEDIR}/lint.opam: Passed. ### : E60: Upstream check failed ### opam-version: "2.0"