support bracketed version numbers
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
33019d2548
commit
2c098d4f23
|
@ -24,7 +24,7 @@ pub(crate) fn read(fname: PathBuf, tag: String) -> Result<String> {
|
|||
|
||||
let found_tag = String::from_utf8(nd.content.clone())?;
|
||||
|
||||
if found_tag == tag {
|
||||
if found_tag == tag || found_tag == format!("[{}]", tag) {
|
||||
collect = true;
|
||||
}
|
||||
} else {
|
||||
|
@ -70,7 +70,7 @@ where
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn read_changelog() {
|
||||
fn basic() {
|
||||
let res = super::read("testdata/basic.md".into(), "0.1.0".into());
|
||||
assert!(res.is_ok());
|
||||
let delta = res.unwrap();
|
||||
|
@ -79,4 +79,15 @@ mod tests {
|
|||
"Hi there this is a test\\!\n### ADDED\n - something\n"
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn brackets() {
|
||||
let res = super::read("testdata/brackets.md".into(), "0.1.0".into());
|
||||
assert!(res.is_ok());
|
||||
let delta = res.unwrap();
|
||||
assert_eq!(
|
||||
delta,
|
||||
"Hi there this is a test\\!\n### ADDED\n - something\n"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
## [0.1.0]
|
||||
Hi there this is a test!
|
||||
### ADDED
|
||||
- something
|
Loading…
Reference in New Issue