diff --git a/parsers/src/util/macro_tests.rs b/parsers/src/util/macro_tests.rs index d66a30d3..8e457f7c 100644 --- a/parsers/src/util/macro_tests.rs +++ b/parsers/src/util/macro_tests.rs @@ -1034,6 +1034,25 @@ fn optional_attribute_extract_positive_present() { } } +#[test] +fn optional_attribute_extract_positive_present_empty() { + #[allow(unused_imports)] + use std::{ + option::Option::{None, Some}, + result::Result::{Err, Ok}, + }; + match parse_str::( + "", + ) { + Ok(OptionalAttributeExtract { + contents: Some(contents), + }) => { + assert_eq!(contents, ""); + } + other => panic!("unexpected result: {:?}", other), + } +} + #[test] fn optional_attribute_extract_positive_absent() { #[allow(unused_imports)] @@ -1060,6 +1079,18 @@ fn optional_attribute_extract_roundtrip_present() { ) } +#[test] +fn optional_attribute_extract_roundtrip_present_empty() { + #[allow(unused_imports)] + use std::{ + option::Option::{None, Some}, + result::Result::{Err, Ok}, + }; + roundtrip_full::( + "", + ) +} + #[test] fn optional_attribute_extract_roundtrip_absent() { #[allow(unused_imports)]