mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 05:33:04 +02:00
regex: add unit tests for non-matching anchor bytes
This is in addition to the integration level test added in 581a35e568c3acd32461d276a4cfe746524e17cd.
This commit is contained in:
parent
a77b914e7a
commit
35b52d33b9
@ -128,4 +128,12 @@ mod tests {
|
|||||||
assert_eq!(sparse(&extract(r"\xFF")), sparse_except(&[0xC3, 0xBF]));
|
assert_eq!(sparse(&extract(r"\xFF")), sparse_except(&[0xC3, 0xBF]));
|
||||||
assert_eq!(sparse(&extract(r"(?-u)\xFF")), sparse_except(&[0xFF]));
|
assert_eq!(sparse(&extract(r"(?-u)\xFF")), sparse_except(&[0xFF]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn anchor() {
|
||||||
|
assert_eq!(sparse(&extract(r"^")), sparse_except(&[b'\n']));
|
||||||
|
assert_eq!(sparse(&extract(r"$")), sparse_except(&[b'\n']));
|
||||||
|
assert_eq!(sparse(&extract(r"\A")), sparse_except(&[b'\n']));
|
||||||
|
assert_eq!(sparse(&extract(r"\z")), sparse_except(&[b'\n']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user