Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

test: add more metadata for the basic case #35

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 33 additions & 11 deletions tests/testsuite/cargo_information/basic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,40 @@ use cargo_test_support::{
#[cargo_test]
fn case() {
cargo_test_support::registry::init();
for ver in [
"0.1.1+my-package",
"0.2.0+my-package",
"0.2.3+my-package",
"0.4.1+my-package",
"20.0.0+my-package",
"99999.0.0+my-package",
"99999.0.0-alpha.1+my-package",
] {
cargo_test_support::registry::Package::new("my-package", ver).publish();
}
cargo_test_support::registry::Package::new("my-package", "0.1.0")
.file(
"Cargo.toml",
r#"
[package]
name = "my-package"
version = "0.1.0"
description = "A package for testing"
repository = "https://github.com/hi-rustin/cargo-infromation"
license = "MIT"
edition = "2018"
rust-version = "1.50.0"
keywords = ["foo", "bar", "baz"]

[features]
default = ["feature1"]
feature1 = []
feature2 = []

[dependencies]
foo = "0.1.0"
bar = "0.2.0"
baz = { version = "0.3.0", optional = true }

[[bin]]
name = "my_bin"

[lib]
name = "my_lib"
"#,
)
.file("src/bin/my_bin.rs", "")
.file("src/lib.rs", "")
.publish();
snapbox::cmd::Command::new(snapbox::cmd::cargo_bin("info"))
.with_assert(compare::assert_ui())
.test_env()
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_information/basic/stderr.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Updating `dummy-registry` index
Downloading crates ...
Downloaded my-package v99999.0.0+my-package (registry `dummy-registry`)
Downloaded my-package v0.1.0 (registry `dummy-registry`)
21 changes: 16 additions & 5 deletions tests/testsuite/cargo_information/basic/stdout.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
my-package
version: 99999.0.0+my-package
license: unknown
rust-version: unknown
documentation: https://docs.rs/my-package/99999.0.0+my-package
my-package #foo #bar #baz
A package for testing
version: 0.1.0
license: MIT
rust-version: 1.50.0
documentation: https://docs.rs/my-package/0.1.0
repository: https://github.com/hi-rustin/cargo-infromation
features:
default = [feature1]
feature1 = []
baz = [dep:baz]
feature2 = []
dependencies:
bar@0.2.0
baz@0.3.0
foo@0.1.0
Loading