Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 50264c9

Browse files
committed
[update] macros/tests
1 parent 72bfaea commit 50264c9

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

‎crates/macros/src/impl/modifier.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub fn proc_macro_impl(_args: TokenStream, ast: ItemTrait) -> TokenStream {
1313
#ast
1414

1515
// 文脈マクロ
16+
#[macro_export]
1617
macro_rules! #macro_ident {
1718
($($body:tt)*) => {{
1819
// 文脈付き呼び出しへの変換

‎crates/macros/tests/modifier.rs‎

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,13 @@
11
use mymodifier_macros::*;
22

33
#[modifier]
4-
trait A {}
4+
pubtrait A {}
55

66
#[modifier]
7-
trait B {}
7+
pubtrait B {}
88

99
#[modifier]
10-
trait C {}
11-
12-
#[modifier_callee(A)]
13-
fn fn_a() {}
14-
15-
#[modifier_callee(B + C)]
16-
fn fn_b_c() {}
10+
pub trait C {}
1711

1812
#[test]
19-
fn check_compile_modifier() {
20-
struct Ctx;
21-
22-
a! {
23-
fn_a();
24-
b! {
25-
c! {
26-
fn_b_c();
27-
}
28-
}
29-
}
30-
}
13+
fn check_compile() {}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
use mymodifier_macros::*;
2+
3+
#[modifier]
4+
trait A {}
5+
6+
#[modifier]
7+
trait B {}
8+
9+
#[modifier]
10+
trait C {}
11+
12+
#[modifier_callee(A)]
13+
fn fn_a() {}
14+
15+
#[modifier_callee(B + C)]
16+
fn fn_b_c() {}
17+
18+
#[test]
19+
fn check_compile() {
20+
struct Ctx;
21+
22+
a! {
23+
fn_a();
24+
b! {
25+
c! {
26+
fn_b_c();
27+
}
28+
}
29+
}
30+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /