Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
case with single "#" in given line not being stripped
  • Loading branch information
budziq committed Jul 31, 2017
1 parent 4eba2f7 commit 54841cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/skeptic/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ fn clean_omitted_line(line: &String) -> &str {

if trimmed.starts_with("# ") {
&trimmed[2..]
} else if trimmed.trim_right() == "#" {
// line consists of single "#" which might not be followed by newline on windows
&trimmed[1..]
} else {
line
}
Expand Down
11 changes: 11 additions & 0 deletions tests/hashtag-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ fn main() {
}
```

Rust code that includes lines with single "`#`" should be tested by skeptic without error.

```rust
#
struct Person<'a>(&'a str);
#
fn main() {
let _ = Person("#bors");
}
```

Rust code with hidden parts "`# `" should be tested by skeptic without error.

```rust
Expand Down

0 comments on commit 54841cf

Please sign in to comment.