address: the backslash joint as a character literal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-19 23:33:51 +01:00
commit 08d29e9113
2 changed files with 2 additions and 2 deletions

View file

@ -110,7 +110,7 @@ pub(crate) fn names_whole_word(text: &str, name: &str, exact: bool) -> bool {
/// A character that joins a word to more of the same token: a letter, a digit, or a path or identifier joint.
fn joins(c: char) -> bool {
c.is_alphanumeric() || matches!(c, '-' | '_' | '/' | '\')
c.is_alphanumeric() || matches!(c, '-' | '_' | '/' | '\\')
}
/// Whether the text after a name carries the token on: a joining character, or a `.` with a letter or digit after it.

View file

@ -142,7 +142,7 @@ fn a_direct_message_is_for_her_whatever_the_basis() {
#[test]
fn a_name_inside_a_path_or_an_identifier_is_not_her_name() {
let eureka = Addressee::new("@eureka:chat", ["Eureka"]);
for path in ["the trace at /var/lib/mind-eureka/persona-trace.cc grew", "see eureka.cc", "eureka_state is a crate", "C:\eureka\x", "mind-eureka@ is a unit"] {
for path in ["the trace at /var/lib/mind-eureka/persona-trace.cc grew", "see eureka.cc", "eureka_state is a crate", "C:\\eureka\\x", "mind-eureka@ is a unit"] {
assert!(!addresses(&eureka, &said(path, &[])), "{path:?} does not name her");
}
for spoken in ["Eureka.", "Eureka, are you there?", "ask eureka.", "(Eureka)", "@Eureka hi", "\"Eureka\" said it", "Eureka's turn"] {