Conversation
|
Hi @alecmocatta, I looked at #72 and this PR should implement your idea. If you're still interested, then please let me know if this does what you expect. Thanks! |
927b9df to
a04a360
Compare
|
Thanks for the ping @mgeisler! Yeah this addresses exactly what I was looking for, so many thanks and I look forward to adopting it! One thing maybe worth considering is accepting abridged semver versions where they're "compatible", e.g. permitting |
Oh, that's a good idea, let me see if I can implement this somehow! |
327c1a9 to
63652d6
Compare
|
Okay, I've pushed a new version which compares the versions in the same way as the other macros: so |
63652d6 to
1d4c057
Compare
1d4c057 to
50d6c59
Compare
This macro compliments the existing `assert_contains_regex!`. While
`assert_contains_regex!` implements the “exists” quantifier, the new
macro implements a “for all” quantifier.
In more details, the macro uses two steps:
1. Replace `{version}` in the `template` by a regular expression which
will match _any_ SemVer version number. This allows, say,
`docs.rs/{name}/{version}/` to match old and outdated occurrences
of your package.
2. Find all matches in the file and check each match against
`template`. This time we replace `{version}` with `pkg_version` so
that we can do an accurate comparison with the actual package
version.
This allows you to ensure that, say, all `docs.rs` links are updated.
Fixes #72.
50d6c59 to
19b1ed5
Compare
This macro compliments the existing
assert_contains_regex!. Whileassert_contains_regex!implements the “exists” quantifier, the new macro implements a “for all” quantifier.In more details, the macro uses two steps:
Replace
{version}in thetemplateby a regular expression which will match any SemVer version number. This allows, say,docs.rs/{name}/{version}/to match old and outdated occurrences of your package.Find all matches in the file and check each match against
template. This time we replace{version}withpkg_versionso that we can do an accurate comparison with the actual package version.This allows you to ensure that, say, all
docs.rslinks are updated.Fixes #72.