Skip to content

Commit

Permalink
Add test to ensure non extended ASCII values are not parsed in value
Browse files Browse the repository at this point in the history
  • Loading branch information
SRv6d committed Sep 28, 2024
1 parent a6bbb58 commit 97ea70c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/parser/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ pub fn consume_continuation_char(input: &mut &str) -> PResult<()> {

#[cfg(test)]
mod tests {
use proptest::prelude::*;
use rstest::*;

use super::*;
Expand Down Expand Up @@ -225,6 +226,15 @@ mod tests {
assert_eq!(*given, remaining);
}

proptest! {
/// Any non extended ASCII is not returned by the value parser.
#[test]
fn attribute_value_non_extended_ascii_not_parsed(s in r"[^\x00-\xFF]+") {
let parsed = attribute_value(&mut s.as_str()).unwrap();
prop_assert_eq!(parsed, "");
}
}

#[rstest]
#[case(
&mut " continuation value prefixed by a space\n",
Expand Down

0 comments on commit 97ea70c

Please sign in to comment.