Skip to content

Commit

Permalink
refactor: remove raw hashes that are unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
hamirmahal committed Dec 22, 2024
1 parent 0535b80 commit dd2a38a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions harper-core/src/language_detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ mod tests {
#[test]
fn detects_python_fib() {
assert_not_english(
r#"
r"
def fibIter(n):
if n < 2:
return n
Expand All @@ -115,7 +115,7 @@ def fibIter(n):
for _ in range(2, n):
fibPrev, fib = fib, fib + fibPrev
return fib
"#,
",
);
}

Expand Down
28 changes: 14 additions & 14 deletions harper-core/src/lexing/email_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,23 @@ mod tests {

fn example_local_parts() -> impl Iterator<Item = Vec<char>> {
[
r#"simple"#,
r#"very.common"#,
r#"x"#,
r#"long.email-address-with-hyphens"#,
r#"user.name+tag+sorting"#,
r#"name/surname"#,
r#"admin"#,
r#"example"#,
r"simple",
r"very.common",
r"x",
r"long.email-address-with-hyphens",
r"user.name+tag+sorting",
r"name/surname",
r"admin",
r"example",
r#"" ""#,
r#""john..doe""#,
r#"mailhost!username"#,
r"mailhost!username",
r#""very.(),:;<>[]\".VERY.\"very@\\ \"very\".unusual""#,
r#"user%example.com"#,
r#"user-"#,
r#"postmaster"#,
r#"postmaster"#,
r#"_test"#,
r"user%example.com",
r"user-",
r"postmaster",
r"postmaster",
r"_test",
]
.into_iter()
.map(|s| s.chars().collect())
Expand Down
28 changes: 14 additions & 14 deletions harper-core/src/lexing/hostname.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ pub mod tests {

pub fn example_domain_parts() -> impl Iterator<Item = Vec<char>> {
[
r#"example.com"#,
r#"example.com"#,
r#"example.com"#,
r#"and.subdomains.example.com"#,
r#"example.com"#,
r#"example.com"#,
r#"example"#,
r#"s.example"#,
r#"example.org"#,
r#"example.org"#,
r#"example.org"#,
r#"strange.example.com"#,
r#"example.org"#,
r#"example.org"#,
r"example.com",
r"example.com",
r"example.com",
r"and.subdomains.example.com",
r"example.com",
r"example.com",
r"example",
r"s.example",
r"example.org",
r"example.org",
r"example.org",
r"strange.example.com",
r"example.org",
r"example.org",
]
.into_iter()
.map(|s| s.chars().collect())
Expand Down
12 changes: 6 additions & 6 deletions harper-core/src/parsers/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ mod tests {

#[test]
fn survives_emojis() {
let source = r#"🤷."#;
let source = r"🤷.";

Markdown.parse_str(source);
}
Expand All @@ -284,7 +284,7 @@ mod tests {

#[test]
fn math_becomes_unlintable() {
let source = r#"$\Katex$ $\text{is}$ $\text{great}$."#;
let source = r"$\Katex$ $\text{is}$ $\text{great}$.";

let tokens = Markdown.parse_str(source);
assert_eq!(
Expand All @@ -302,7 +302,7 @@ mod tests {

#[test]
fn hidden_wikilink_text() {
let source = r#"[[this is hidden|this is not]]"#;
let source = r"[[this is hidden|this is not]]";

let tokens = Markdown.parse_str(source);

Expand All @@ -322,7 +322,7 @@ mod tests {

#[test]
fn improper_wikilink_text() {
let source = r#"this is shown|this is also shown]]"#;
let source = r"this is shown|this is also shown]]";

let tokens = Markdown.parse_str(source);

Expand Down Expand Up @@ -354,7 +354,7 @@ mod tests {

#[test]
fn normal_wikilink() {
let source = r#"[[Wikilink]]"#;
let source = r"[[Wikilink]]";
let tokens = Markdown.parse_str(source);
let token_kinds = tokens.iter().map(|t| t.kind).collect::<Vec<_>>();

Expand All @@ -365,7 +365,7 @@ mod tests {

#[test]
fn html_is_unlintable() {
let source = r#"The range of inputs from <ctrl-g> to ctrl-z"#;
let source = r"The range of inputs from <ctrl-g> to ctrl-z";
let tokens = Markdown.parse_str(source);
assert_eq!(tokens.iter_unlintables().count(), 1);
}
Expand Down

0 comments on commit dd2a38a

Please sign in to comment.