Add a GetStandardProperties trait.
This commit is contained in:
@@ -445,7 +445,7 @@ mod tests {
|
||||
use crate::context::Context;
|
||||
use crate::context::GlobalSettings;
|
||||
use crate::context::List;
|
||||
use crate::types::Source;
|
||||
use crate::types::GetStandardProperties;
|
||||
|
||||
#[test]
|
||||
fn plain_list_item_empty() {
|
||||
@@ -456,7 +456,7 @@ mod tests {
|
||||
let plain_list_item_matcher = parser_with_context!(plain_list_item)(&initial_context);
|
||||
let (remaining, result) = plain_list_item_matcher(input).unwrap();
|
||||
assert_eq!(Into::<&str>::into(remaining), "");
|
||||
assert_eq!(result.source, "1.");
|
||||
assert_eq!(result.get_standard_properties().get_source(), "1.");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -468,7 +468,7 @@ mod tests {
|
||||
let plain_list_item_matcher = parser_with_context!(plain_list_item)(&initial_context);
|
||||
let (remaining, result) = plain_list_item_matcher(input).unwrap();
|
||||
assert_eq!(Into::<&str>::into(remaining), "");
|
||||
assert_eq!(result.source, "1. foo");
|
||||
assert_eq!(result.get_standard_properties().get_source(), "1. foo");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -480,7 +480,7 @@ mod tests {
|
||||
let plain_list_matcher = parser_with_context!(plain_list)(&initial_context);
|
||||
let (remaining, result) = plain_list_matcher(input).unwrap();
|
||||
assert_eq!(Into::<&str>::into(remaining), "");
|
||||
assert_eq!(result.source, "1.");
|
||||
assert_eq!(result.get_standard_properties().get_source(), "1.");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -492,7 +492,7 @@ mod tests {
|
||||
let plain_list_matcher = parser_with_context!(plain_list)(&initial_context);
|
||||
let (remaining, result) = plain_list_matcher(input).unwrap();
|
||||
assert_eq!(Into::<&str>::into(remaining), "");
|
||||
assert_eq!(result.source, "1. foo");
|
||||
assert_eq!(result.get_standard_properties().get_source(), "1. foo");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -539,7 +539,7 @@ mod tests {
|
||||
plain_list_matcher(input).expect("Should parse the plain list successfully.");
|
||||
assert_eq!(Into::<&str>::into(remaining), " ipsum\n");
|
||||
assert_eq!(
|
||||
result.get_source(),
|
||||
result.get_standard_properties().get_source(),
|
||||
r#"1. foo
|
||||
2. bar
|
||||
baz
|
||||
@@ -567,7 +567,7 @@ baz"#,
|
||||
plain_list_matcher(input).expect("Should parse the plain list successfully.");
|
||||
assert_eq!(Into::<&str>::into(remaining), "baz");
|
||||
assert_eq!(
|
||||
result.get_source(),
|
||||
result.get_standard_properties().get_source(),
|
||||
r#"1. foo
|
||||
1. bar
|
||||
|
||||
@@ -600,7 +600,7 @@ dolar"#,
|
||||
plain_list_matcher(input).expect("Should parse the plain list successfully.");
|
||||
assert_eq!(Into::<&str>::into(remaining), "dolar");
|
||||
assert_eq!(
|
||||
result.get_source(),
|
||||
result.get_standard_properties().get_source(),
|
||||
r#"1. foo
|
||||
|
||||
bar
|
||||
|
||||
Reference in New Issue
Block a user