Skip to content

Commit

Permalink
tests: Pin easytime to 0.2.5
Browse files Browse the repository at this point in the history
easytime 0.2.6 requires Rust 1.58, but we run tests on older rustc versions.
  • Loading branch information
taiki-e committed Aug 27, 2023
1 parent dcd72a2 commit 0e73a9c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 21 deletions.
3 changes: 2 additions & 1 deletion tests/fixtures/namespaced_features/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ resolver = "2"
easytime = ["dep:easytime"]

[dependencies]
easytime = { version = "0.2", optional = true, default-features = false }
# easytime 0.2.6 requires Rust 1.58
easytime = { version = "=0.2.5", optional = true, default-features = false }

[dev-dependencies]
3 changes: 2 additions & 1 deletion tests/fixtures/powerset_deduplication/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ e = ["b", "d"]

[dependencies]
member1 = { path = "member1", optional = true }
easytime = { version = "0.2", default-features = false }
# easytime 0.2.6 requires Rust 1.58
easytime = { version = "=0.2.5", default-features = false }

[dev-dependencies]
46 changes: 27 additions & 19 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,12 @@ fn feature_powerset_failure() {

#[test]
fn powerset_deduplication() {
// basic
// require Rust 1.34 due to easytime requires it.
let require = Some(34);

// basic
cargo_hack(["check", "--feature-powerset"])
.assert_success2("powerset_deduplication", Some(34))
.assert_success2("powerset_deduplication", require)
.stderr_contains(
"
running `cargo check --no-default-features` on deduplication (1/10)
Expand Down Expand Up @@ -502,7 +504,7 @@ fn powerset_deduplication() {

// with --optional-deps
cargo_hack(["check", "--feature-powerset", "--optional-deps"])
.assert_success2("powerset_deduplication", Some(34))
.assert_success2("powerset_deduplication", require)
.stderr_contains(
"
running `cargo check --no-default-features` on deduplication (1/14)
Expand Down Expand Up @@ -534,7 +536,7 @@ fn powerset_deduplication() {

// with --group-features
cargo_hack(["check", "--feature-powerset", "--group-features", "b,d"])
.assert_success2("powerset_deduplication", Some(34))
.assert_success2("powerset_deduplication", require)
.stderr_contains(
"
running `cargo check --no-default-features` on deduplication (1/7)
Expand All @@ -555,7 +557,7 @@ fn powerset_deduplication() {

// with --group-features + --optional-deps
cargo_hack(["check", "--feature-powerset", "--group-features", "b,d", "--optional-deps"])
.assert_success2("powerset_deduplication", Some(34))
.assert_success2("powerset_deduplication", require)
.stderr_contains(
"
running `cargo check --no-default-features` on deduplication (1/10)
Expand Down Expand Up @@ -1068,8 +1070,10 @@ fn not_find_manifest() {
#[test]
fn optional_deps() {
// require Rust 1.31 due to optional_deps uses renamed deps
let require = Some(31);

cargo_hack(["run", "--features=real,member2,renamed", "--ignore-unknown-features"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains(
"
skipped applying unknown `member2` feature to optional_deps
Expand All @@ -1090,7 +1094,7 @@ fn optional_deps() {
);

cargo_hack(["check", "--each-feature"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains(
"
running `cargo check --no-default-features` on optional_deps (1/2)
Expand All @@ -1105,7 +1109,7 @@ fn optional_deps() {
);

cargo_hack(["check", "--each-feature", "--optional-deps"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains(
"
running `cargo check --no-default-features` on optional_deps (1/4)
Expand All @@ -1116,7 +1120,7 @@ fn optional_deps() {
);

cargo_hack(["check", "--each-feature", "--optional-deps", "real"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains(
"
running `cargo check --no-default-features` on optional_deps (1/3)
Expand All @@ -1127,7 +1131,7 @@ fn optional_deps() {
.stderr_not_contains("--features renamed");

cargo_hack(["check", "--each-feature", "--optional-deps=renamed"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains(
"
running `cargo check --no-default-features` on optional_deps (1/3)
Expand All @@ -1138,7 +1142,7 @@ fn optional_deps() {
.stderr_not_contains("--features real");

cargo_hack(["check", "--each-feature", "--optional-deps="])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains(
"
running `cargo check --no-default-features` on optional_deps (1/2)
Expand All @@ -1159,8 +1163,10 @@ fn optional_deps_failure() {
#[test]
fn skip_optional_deps() {
// require Rust 1.31 due to optional_deps uses renamed deps
let require = Some(31);

cargo_hack(["check", "--each-feature", "--optional-deps", "--exclude-features", "real"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains(
"
running `cargo check --no-default-features` on optional_deps (1/2)
Expand All @@ -1173,32 +1179,34 @@ fn skip_optional_deps() {
#[test]
fn list_separator() {
// require Rust 1.31 due to optional_deps uses renamed deps
let require = Some(31);

cargo_hack(["run", "--features='real,renamed'"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains("running `cargo run --features real,renamed` on optional_deps");

cargo_hack(["run", "--features=\"real,renamed\""])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains("running `cargo run --features real,renamed` on optional_deps");

cargo_hack(["run", "--features=real,renamed"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains("running `cargo run --features real,renamed` on optional_deps");

cargo_hack(["run", "--features", "real,renamed"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains("running `cargo run --features real,renamed` on optional_deps");

cargo_hack(["run", "--features='real renamed'"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains("running `cargo run --features real,renamed` on optional_deps");

cargo_hack(["run", "--features=\"real renamed\""])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains("running `cargo run --features real,renamed` on optional_deps");

cargo_hack(["run", "--features", "real renamed"])
.assert_success2("optional_deps", Some(31))
.assert_success2("optional_deps", require)
.stderr_contains("running `cargo run --features real,renamed` on optional_deps");
}

Expand Down

0 comments on commit 0e73a9c

Please sign in to comment.