From cd35e0d184c7e3a4b97e6c65530592f74136c77f Mon Sep 17 00:00:00 2001 From: Paul Fenwick Date: Thu, 11 Dec 2014 11:21:05 +1100 Subject: [PATCH] Tests: Allow for -PRE in stable release numbers. This means we can release `v1.2.0-PRE1` without our test cases going silly. This release will read `v1.2` spec files (since its version number is greater than the spec_version), but we're not necessarily calling it a release candidate. Internally `ckan.dll` and friends don't care about the version number at all, except to compare it as a `Version` object against the `spec_version` in our metadata. We could have `cheese sandwich` as a version and the core would accept that as being okay. ;) --- CKAN/Tests/CKAN/Meta.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CKAN/Tests/CKAN/Meta.cs b/CKAN/Tests/CKAN/Meta.cs index c79191a1ce..3abeb5ea5a 100644 --- a/CKAN/Tests/CKAN/Meta.cs +++ b/CKAN/Tests/CKAN/Meta.cs @@ -32,11 +32,11 @@ public void ReleaseNumber() } // We should always be in the form v0.xx (pre-release series), - // or vx.x.x (released). We also permit a (-RC\d) extension for - // release candidates. + // or vx.x.x (released). We also permit a (-RC\d+) extension for + // release candidates, and -PRE\d for pre-releases. Assert.IsTrue( - Regex.IsMatch(version.ToString(), @"^v(?:0.\d+|\d+\.\d+\.\d+(?:-RC\d+)?)$"), + Regex.IsMatch(version.ToString(), @"^v(?:0.\d+|\d+\.\d+\.\d+(?:-(?:RC|PRE)\d+)?)$"), version.ToString()); } }