Skip to content

Commit

Permalink
Merge pull request #241 from JohnTitor/extract-macro-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Oct 16, 2021
2 parents da98b9e + 8cf694d commit 7b0a313
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -33,8 +33,8 @@ jobs:

- name: phf_macros UI test
if: matrix.version == '1.46.0'
working-directory: phf_macros
run: cargo test --features=unicase -- --ignored --test-threads=1
working-directory: phf_macros_tests
run: cargo test -- --ignored --test-threads=1

- name: phf_codegen test
run: cargo test -p phf_codegen_test
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -5,12 +5,12 @@ members = [
"phf_codegen/test",
"phf_generator",
"phf_macros",
"phf_macros_tests",
"phf_shared"
]

[patch.crates-io]
phf = { path = "phf" }
phf_codegen = { path = "./phf_codegen" }
phf_generator = { path = "./phf_generator" }
phf_macros = { path = "./phf_macros" }
phf_shared = { path = "./phf_shared" }
2 changes: 1 addition & 1 deletion phf_codegen/test/Cargo.toml
Expand Up @@ -11,6 +11,6 @@ uncased = { version = "0.9.6", default-features = false }
unicase = "2.4.0"

[build-dependencies]
phf_codegen = "0.10.0"
phf_codegen = { version = "0.10.0", path = ".." }
unicase = "2.4.0"
uncased = { version = "0.9.6", default-features = false }
5 changes: 0 additions & 5 deletions phf_macros/Cargo.toml
Expand Up @@ -24,8 +24,3 @@ unicase_ = { package = "unicase", version = "2.4.0", optional = true }

phf_generator = "0.10.0"
phf_shared = { version = "0.10.0", default-features = false }

[dev-dependencies]
trybuild = "1.0"
phf = { version = "0.10", features = ["macros", "unicase"] }
unicase_ = { package = "unicase", version = "2.4.0" }
15 changes: 15 additions & 0 deletions phf_macros_tests/Cargo.toml
@@ -0,0 +1,15 @@
[package]
name = "phf_macros_tests"
version = "0.1.0"
authors = ["Yuki Okushi <jtitor@2k36.org>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

[dev-dependencies]
trybuild = "1.0"
phf = { version = "0.10", features = ["macros"] }
phf_macros = { version = "0.10", features = ["unicase"] }
unicase = "2.4.0"
File renamed without changes.
1 change: 1 addition & 0 deletions phf_macros_tests/src/lib.rs
@@ -0,0 +1 @@

@@ -1,4 +1,4 @@
use unicase_::UniCase;
use unicase::UniCase;
use phf::phf_map;

static MAP: phf::Map<UniCase<&'static str>, isize> = phf_map!(
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions phf_macros/tests/test.rs → phf_macros_tests/tests/test.rs
Expand Up @@ -240,10 +240,9 @@ mod map {
}
}

#[cfg(feature = "unicase")]
#[test]
fn test_unicase() {
use unicase_::UniCase;
use unicase::UniCase;
static MAP: phf::Map<UniCase<&'static str>, isize> = phf_map!(
UniCase::ascii("FOO") => 10,
UniCase::unicode("Bar") => 11,
Expand Down
@@ -1,5 +1,9 @@
// The diagnostics may be different between stable and nightly, so
// we mark them as `#[ignore]` and invoke with `--ignored` explicitly
// when testing.

#[test]
#[ignore] // diagnostics may be different between stable and nightly.
#[ignore]
fn compile_test_unicase() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/compile-fail-unicase/*.rs");
Expand Down

0 comments on commit 7b0a313

Please sign in to comment.