Skip to content

Commit 3d8e0d3

Browse files
committed
Add more test cases
1 parent 98426f5 commit 3d8e0d3

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

tests/ui/doc_suspicious_footnotes.fixed

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub fn footnotes() {
3838
}
3939

4040
pub struct Foo;
41+
#[rustfmt::skip]
4142
impl Foo {
4243
#[doc = r#"[^2]: hello world
4344

@@ -90,6 +91,13 @@ This is not a footnote[^either], but it doesn't warn.
9091
pub fn footnotes3() {
9192
// test code goes here
9293
}
94+
#[doc = "My footnote [^foot\note]"]
95+
pub fn footnote4() {
96+
// test code goes here
97+
}
98+
#[doc = "Hihi"]pub fn footnote5() {
99+
// test code goes here
100+
}
93101
}
94102

95103
#[doc = r#"[^2]: hello world

tests/ui/doc_suspicious_footnotes.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub fn footnotes() {
3434
}
3535

3636
pub struct Foo;
37+
#[rustfmt::skip]
3738
impl Foo {
3839
#[doc = r#"This is not a footnote[^1]."#]
3940
//~^ doc_suspicious_footnotes
@@ -78,6 +79,13 @@ impl Foo {
7879
pub fn footnotes3() {
7980
// test code goes here
8081
}
82+
#[doc = "My footnote [^foot\note]"]
83+
pub fn footnote4() {
84+
// test code goes here
85+
}
86+
#[doc = "Hihi"]pub fn footnote5() {
87+
// test code goes here
88+
}
8189
}
8290

8391
#[doc = r"This is not a footnote[^1]."]

tests/ui/doc_suspicious_footnotes.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LL + /// [^1]: <!-- description -->
2727
|
2828

2929
error: looks like a footnote ref, but has no matching footnote
30-
--> tests/ui/doc_suspicious_footnotes.rs:38:13
30+
--> tests/ui/doc_suspicious_footnotes.rs:39:13
3131
|
3232
LL | #[doc = r#"This is not a footnote[^1]."#]
3333
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -40,7 +40,7 @@ LL ~ [^1]: <!-- description -->"#]
4040
|
4141

4242
error: looks like a footnote ref, but has no matching footnote
43-
--> tests/ui/doc_suspicious_footnotes.rs:55:13
43+
--> tests/ui/doc_suspicious_footnotes.rs:56:13
4444
|
4545
LL | #[doc = "This is not a footnote[^1].
4646
| _____________^
@@ -72,7 +72,7 @@ LL ~ [^1]: <!-- description -->"#]
7272
|
7373

7474
error: looks like a footnote ref, but has no matching footnote
75-
--> tests/ui/doc_suspicious_footnotes.rs:75:15
75+
--> tests/ui/doc_suspicious_footnotes.rs:76:15
7676
|
7777
LL | doc = "This is not a footnote[^1].\n\nThis is not a footnote[^either], but it doesn't warn."
7878
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -87,7 +87,7 @@ LL + [^1]: <!-- description -->"#
8787
|
8888

8989
error: looks like a footnote ref, but has no matching footnote
90-
--> tests/ui/doc_suspicious_footnotes.rs:83:9
90+
--> tests/ui/doc_suspicious_footnotes.rs:91:9
9191
|
9292
LL | #[doc = r"This is not a footnote[^1]."]
9393
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -100,7 +100,7 @@ LL ~ [^1]: <!-- description -->"#]
100100
|
101101

102102
error: looks like a footnote ref, but has no matching footnote
103-
--> tests/ui/doc_suspicious_footnotes.rs:103:30
103+
--> tests/ui/doc_suspicious_footnotes.rs:111:30
104104
|
105105
LL | * This is not a footnote[^1].
106106
| ^^^^
@@ -112,7 +112,7 @@ LL + /*! [^1]: <!-- description --> */
112112
|
113113

114114
error: looks like a footnote ref, but has no matching footnote
115-
--> tests/ui/doc_suspicious_footnotes.rs:114:30
115+
--> tests/ui/doc_suspicious_footnotes.rs:122:30
116116
|
117117
LL | * This is not a footnote[^1].
118118
| ^^^^

0 commit comments

Comments
 (0)