Skip to content

Commit 340050e

Browse files
committed
test(package): Show current case behavior
1 parent cc20b55 commit 340050e

File tree

1 file changed

+47
-7
lines changed

1 file changed

+47
-7
lines changed

tests/testsuite/package.rs

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,8 +3224,12 @@ src/main.rs.bak
32243224
#[cfg(windows)] // windows is the platform that is most consistently configured for case insensitive filesystems
32253225
fn normalize_case() {
32263226
let p = project()
3227-
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
3227+
.file("Build.rs", r#"fn main() { println!("hello"); }"#)
3228+
.file("src/Main.rs", r#"fn main() { println!("hello"); }"#)
3229+
.file("src/lib.rs", "")
32283230
.file("src/bar.txt", "") // should be ignored when packaging
3231+
.file("Examples/ExampleFoo.rs", "")
3232+
.file("Tests/ExplicitPath.rs", "")
32293233
.build();
32303234
// Workaround `project()` making a `Cargo.toml` on our behalf
32313235
std::fs::remove_file(p.root().join("Cargo.toml")).unwrap();
@@ -3235,11 +3239,15 @@ fn normalize_case() {
32353239
[package]
32363240
name = "foo"
32373241
version = "0.0.1"
3238-
edition = "2015"
3242+
edition = "2018"
32393243
authors = []
32403244
exclude = ["*.txt"]
32413245
license = "MIT"
32423246
description = "foo"
3247+
3248+
[[test]]
3249+
name = "explicitpath"
3250+
path = "tests/explicitpath.rs"
32433251
"#,
32443252
)
32453253
.unwrap();
@@ -3253,18 +3261,22 @@ See [..]
32533261
[VERIFYING] foo v0.0.1 ([CWD])
32543262
[COMPILING] foo v0.0.1 ([CWD][..])
32553263
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
3256-
[PACKAGED] 4 files, [..] ([..] compressed)
3264+
[PACKAGED] 8 files, [..] ([..] compressed)
32573265
",
32583266
)
32593267
.run();
32603268
assert!(p.root().join("target/package/foo-0.0.1.crate").is_file());
32613269
p.cargo("package -l")
32623270
.with_stdout(
32633271
"\
3272+
Build.rs
32643273
Cargo.lock
32653274
Cargo.toml
32663275
Cargo.toml.orig
3267-
src/main.rs
3276+
Examples/ExampleFoo.rs
3277+
Tests/ExplicitPath.rs
3278+
src/Main.rs
3279+
src/lib.rs
32683280
",
32693281
)
32703282
.run();
@@ -3277,7 +3289,7 @@ See [..]
32773289
[VERIFYING] foo v0.0.1 ([CWD])
32783290
[COMPILING] foo v0.0.1 ([CWD][..])
32793291
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
3280-
[PACKAGED] 4 files, [..] ([..] compressed)
3292+
[PACKAGED] 8 files, [..] ([..] compressed)
32813293
",
32823294
)
32833295
.run();
@@ -3286,8 +3298,36 @@ See [..]
32863298
validate_crate_contents(
32873299
f,
32883300
"foo-0.0.1.crate",
3289-
&["Cargo.lock", "Cargo.toml", "Cargo.toml.orig", "src/main.rs"],
3290-
&[],
3301+
&[
3302+
"Cargo.lock",
3303+
"Cargo.toml",
3304+
"Cargo.toml.orig",
3305+
"Build.rs",
3306+
"src/Main.rs",
3307+
"src/lib.rs",
3308+
"Examples/ExampleFoo.rs",
3309+
"Tests/ExplicitPath.rs",
3310+
],
3311+
&[(
3312+
"Cargo.toml",
3313+
&format!(
3314+
r#"{}
3315+
[package]
3316+
edition = "2018"
3317+
name = "foo"
3318+
version = "0.0.1"
3319+
authors = []
3320+
exclude = ["*.txt"]
3321+
description = "foo"
3322+
license = "MIT"
3323+
3324+
[[test]]
3325+
name = "explicitpath"
3326+
path = "tests/explicitpath.rs"
3327+
"#,
3328+
cargo::core::manifest::MANIFEST_PREAMBLE
3329+
),
3330+
)],
32913331
);
32923332
}
32933333

0 commit comments

Comments
 (0)