Skip to content

Commit 3c932b6

Browse files
committed
provide our own crate
1 parent 7961196 commit 3c932b6

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

src/docbuilder/rustwide_builder.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,7 @@ mod tests {
12951295
use crate::registry_api::ReleaseData;
12961296
use crate::storage::{CompressionAlgorithm, compression};
12971297
use crate::test::{AxumRouterTestExt, TestEnvironment, wrapper};
1298+
use pretty_assertions::assert_eq;
12981299
use std::{io, iter};
12991300
use test_case::test_case;
13001301

@@ -1985,15 +1986,20 @@ mod tests {
19851986
builder.update_toolchain()?;
19861987
assert!(
19871988
builder
1988-
.build_package(crate_, version, PackageKind::CratesIo, false)?
1989+
.build_local_package(Path::new("tests/crates/optional-dep"))?
19891990
.successful
19901991
);
19911992

1992-
assert!(
1993-
!get_features(env, crate_, version)?
1993+
assert_eq!(
1994+
get_features(env, crate_, version)?
19941995
.unwrap()
19951996
.iter()
1996-
.any(|f| f.name == "with_builtin_macros")
1997+
.map(|f| f.name.to_owned())
1998+
.collect_vec(),
1999+
// "regex" feature is not in the list,
2000+
// because we don't have implicit features for optional dependencies
2001+
// with `dep` syntax any more.
2002+
vec!["default", "std", "alloc", "optional_regex"]
19972003
);
19982004

19992005
Ok(())
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[package]
2+
name = "stylish-core"
3+
version = "0.0.1"
4+
edition = "2024"
5+
6+
[features]
7+
default = ["std"]
8+
std = ["alloc"]
9+
alloc = []
10+
optional_regex = ["dep:regex"]
11+
12+
[dependencies]
13+
regex = { version = "1.11.3", optional = true }

tests/crates/optional-dep/src/lib.rs

Whitespace-only changes.

0 commit comments

Comments
 (0)