k9 icon indicating copy to clipboard operation
k9 copied to clipboard

Trailing space after a backspace in a string will lead to a wrong snapshot

Open KnorrFG opened this issue 1 year ago • 0 comments

Hey, I found a small bug. When the input for the snapshot macro has a \ followed by a space, that backspace will be duplicated in the generated snapshot. That bug is not a problem, because it happens everytime. But the snapshot looks wrong uppon inspection. Here is an example:

#[cfg(test)]
mod tests {
    #[test]
    fn test_foo() {
        k9::snapshot!(r#"\ "#, r#"\\ "#);
    }
}

KnorrFG avatar Oct 18 '23 08:10 KnorrFG