]> git.proxmox.com Git - rustc.git/blame - vendor/rustversion/tests/test_parse.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / vendor / rustversion / tests / test_parse.rs
CommitLineData
136023e0
XL
1#![allow(clippy::enum_glob_use, clippy::must_use_candidate)]
2
f20569fa
XL
3include!("../build/rustc.rs");
4
5#[test]
6fn test_parse() {
7 let cases = &[
8 (
9 "rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)",
10 Version {
11 minor: 0,
12 patch: 0,
13 channel: Stable,
14 },
15 ),
16 (
17 "rustc 1.18.0",
18 Version {
19 minor: 18,
20 patch: 0,
21 channel: Stable,
22 },
23 ),
24 (
25 "rustc 1.24.1 (d3ae9a9e0 2018-02-27)",
26 Version {
27 minor: 24,
28 patch: 1,
29 channel: Stable,
30 },
31 ),
32 (
33 "rustc 1.35.0-beta.3 (c13114dc8 2019-04-27)",
34 Version {
35 minor: 35,
36 patch: 0,
37 channel: Beta,
38 },
39 ),
40 (
41 "rustc 1.36.0-nightly (938d4ffe1 2019-04-27)",
42 Version {
43 minor: 36,
44 patch: 0,
45 channel: Nightly(Date {
46 year: 2019,
47 month: 4,
48 day: 27,
49 }),
50 },
51 ),
52 (
53 "rustc 1.36.0-dev",
54 Version {
55 minor: 36,
56 patch: 0,
57 channel: Dev,
58 },
59 ),
60 (
61 "rustc 1.36.0-nightly",
62 Version {
63 minor: 36,
64 patch: 0,
65 channel: Dev,
66 },
67 ),
68 (
69 "warning: invalid logging spec 'warning', ignoring it
70 rustc 1.30.0-nightly (3bc2ca7e4 2018-09-20)",
71 Version {
72 minor: 30,
73 patch: 0,
74 channel: Nightly(Date {
75 year: 2018,
76 month: 9,
77 day: 20,
78 }),
79 },
80 ),
136023e0
XL
81 (
82 "rustc 1.52.1-nightly (gentoo)",
83 Version {
84 minor: 52,
85 patch: 1,
86 channel: Dev,
87 },
88 ),
f20569fa
XL
89 ];
90
91 for (string, expected) in cases {
92 assert_eq!(parse(string).unwrap(), *expected);
93 }
94}