File: test_toolchain.rs

package info (click to toggle)
rust-eyre 0.6.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 388 kB
  • sloc: makefile: 2
file content (34 lines) | stat: -rw-r--r-- 930 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// These tests check our build script against rustversion.

#[rustversion::attr(not(nightly), ignore)]
#[test]
fn nightlytest() {
    if !cfg!(nightly) {
        panic!("nightly feature isn't set when the toolchain is nightly.");
    }
    if cfg!(any(beta, stable)) {
        panic!("beta, stable, and nightly are mutually exclusive features.")
    }
}

#[rustversion::attr(not(beta), ignore)]
#[test]
fn betatest() {
    if !cfg!(beta) {
        panic!("beta feature is not set when the toolchain is beta.");
    }
    if cfg!(any(nightly, stable)) {
        panic!("beta, stable, and nightly are mutually exclusive features.")
    }
}

#[rustversion::attr(not(stable), ignore)]
#[test]
fn stabletest() {
    if !cfg!(stable) {
        panic!("stable feature is not set when the toolchain is stable.");
    }
    if cfg!(any(nightly, beta)) {
        panic!("beta, stable, and nightly are mutually exclusive features.")
    }
}