Skip to content

Commit

Permalink
reftest: add more test for lint w59
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Oct 11, 2024
1 parent 9cd932c commit 2ed2430
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ users)
* More exhaustive test for pin command: test different behaviour and cli options [#6135 @rjbou]
* pin: add a test for erroneous first fetch done as local path on local VCS pinned packages [#6221 @rjbou]
* Add cache test for installed packages cache update after an action failure [#6213 @kit-ty-kate @rjbou]
* Add more tests for lint W59 [#6219 @rjbou]

### Engine
* Update print file function [#6233 @rjbou]
Expand Down
55 changes: 53 additions & 2 deletions tests/reftests/lint.test
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@ ${BASEDIR}/lint.opam: Warnings.
### opam lint ./lint.opam --check-upstream
${BASEDIR}/lint.opam: Warnings.
warning 59: url doesn't contain a checksum
### # package with conf flag
### <lint.opam>
opam-version: "2.0"
synopsis: "A word"
Expand All @@ -864,7 +865,6 @@ 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
Expand All @@ -873,6 +873,7 @@ ${BASEDIR}/lint.opam: Errors.
${BASEDIR}/lint.opam: Errors.
error 46: Package is flagged "conf" but has source, install or remove instructions
# Return code 1 #
### # package with git url
### <lint.opam>
opam-version: "2.0"
synopsis: "A word"
Expand All @@ -884,7 +885,57 @@ 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.
### # package with local url
### <repo/stuff>
something
### <lint.opam>
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"
### <add-url.sh>
basedir=`echo "$BASEDIR" | sed 's/\\\\/\\\\\\\\\\\\\\\\/g'`
cat << EOF >> lint.opam
url { src:"file://$basedir/an-archive" }
EOF
### sh add-url.sh
### opam lint ./lint.opam
${BASEDIR}/lint.opam: Warnings.
warning 59: url doesn't contain a checksum
### opam lint ./lint.opam --check-upstream
${BASEDIR}/lint.opam: Errors.
warning 59: url doesn't contain a checksum
error 60: Upstream check failed: "Source not found: ${BASEDIR}/an-archive"
# Return code 1 #
### # package with local archive url
### <lint.opam>
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"
### <add-url.sh>
basedir=`echo "$BASEDIR" | sed 's/\\\\/\\\\\\\\\\\\\\\\/g'`
cat << EOF >> lint.opam
url {
src:"file://$basedir/an-archive.tgz"
checksum: "md5=$(openssl md5 an-archive.tgz | cut -f2 -d' ')"
}
EOF
### sh add-url.sh
### opam lint ./lint.opam
${BASEDIR}/lint.opam: Passed.
### opam lint ./lint.opam --check-upstream
Expand Down

0 comments on commit 2ed2430

Please sign in to comment.