Skip to content

Commit

Permalink
tests: Add version parsing test for rustc 1.50
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Aug 31, 2024
1 parent 8abba4b commit b04b77f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ LLVM version: 8.0",
.unwrap();
assert_eq!(v, Version::stable(34, 8));

// rustc 1.50 (rustup)
let v = Version::parse(
"rustc 1.50.0 (cb75ad5db 2021-02-10)
binary: rustc
commit-hash: cb75ad5db02783e8b0222fee363c5f63f7e2cf5b
commit-date: 2021-02-10
host: aarch64-unknown-linux-gnu
release: 1.50.0",
)
.unwrap();
assert_eq!(v, Version::stable(50, 0));

// rustc 1.67 (rustup)
let v = Version::parse(
"rustc 1.67.0 (fc594f156 2023-01-24)
Expand Down Expand Up @@ -275,7 +287,7 @@ LLVM version: 16.0.0",
assert_eq!(v.commit_date().month, 0);
assert_eq!(v.commit_date().day, 0);

// rustc 1.64 (debian 11: apt-get install cargo)
// rustc 1.48 (debian 11: apt-get install cargo)
let v = Version::parse(
"rustc 1.48.0
binary: rustc
Expand Down
1 change: 1 addition & 0 deletions version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ impl Version {
let _patch = digits.next().unwrap_or("0").parse::<u32>().ok()?;
let nightly = channel == "nightly" || channel == "dev";

// Note that rustc 1.49-1.50 (and 1.13 or older) don't print LLVM version.
let llvm_major = (|| {
let version = verbose_version
.lines()
Expand Down

0 comments on commit b04b77f

Please sign in to comment.