On Apr 29, 2013, at 12:11 PM, Daniele Varrazzo <
daniele....@gmail.com> wrote:
> Anything I should know client-side? Can you put together a test suite
> of what syntax is accepted, what not, and if there is some
> normalization rule to be applied etc. (Perl is fine of course:
> whatever test suite you have for server side will be ported to the
> client to check we agree on what's an 1.0).
So it is the same as before, except that "-" is required between the patch level and the prerelease string. For backwards compatibility, the SemVer Perl module and the semver data type allow input without the "-", but will add it for display. The relevant commit for the Perl module and its tests is here:
https://github.com/theory/semver/commit/1e0fcc22b5fe879b902d5161ea3eb4b77a24d848
The tests themselves:
https://github.com/theory/semver/blob/master/t/base.t
And for the semver data type, the changes were (mostly) here:
https://github.com/theory/pg-semver/pull/6/files
And the tests:
https://github.com/theory/pg-semver/blob/master/test/sql/base.sql
In both cases, I tried to offer an interface that requires the hyphen, and one that does not, but it is always include in the output. The upshot is that "1.1.0b1" should be converted to "1.1.0-b1" for output, and considered equivalent.
I think that, for the client, until I fix the broken semvers in the index, you would need to do both. After they're fixed, my expectation is that there would be none without the hyphen, after which you could be strict again. I likely won't be able to clean that stuff up until sometime after PGCon, though.
Best,
David