1 /// Struct containing a version number with some meta data.
2 /// Such a set can be used for testing.
3 ///
4 /// # Arguments
5 ///
6 /// - `0`: The version string.
7 /// - `1`: Number of version parts.
8 pub struct TestVersion(pub &'static str, pub usize);
9 
10 /// List of version numbers with metadata for dynamic tests
11 pub const TEST_VERSIONS: &'static [TestVersion] = &[
12     TestVersion("1", 1),
13     TestVersion("1.2", 2),
14     TestVersion("1.2.3.4", 4),
15     TestVersion("1.2.3.4.5.6.7.8", 8),
16     TestVersion("0", 1),
17     TestVersion("0.0.0", 3),
18     TestVersion("1.0.0", 3),
19     TestVersion("0.0.1", 3),
20     TestVersion("", 0),
21     TestVersion(".", 0),
22     TestVersion("...", 0),
23     TestVersion("1.2.dev", 3),
24     TestVersion("1.2-dev", 3),
25     TestVersion("1.2.alpha.4", 4),
26     TestVersion("1.2-alpha-4", 4),
27     TestVersion("snapshot.1.2", 3),
28     TestVersion("snapshot-1.2", 3),
29     // TODO: inspect and fix this case
30     // TestVersion("version-compare 2.1.8.1 / build 209", 4),
31 ];
32 
33 /// List of version numbers that contain errors with metadata for dynamic tests
34 pub const TEST_VERSIONS_ERROR: &'static [TestVersion] = &[
35     TestVersion("abc", 1),
36     TestVersion("alpha.dev.snapshot", 3),
37     TestVersion("test. .snapshot", 3),
38     // TODO: broken case, decide what to do here
39     // TestVersion("$", 1),
40 ];
41