Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Expand tests to improve code coverage #4

Open
JeanMertz opened this issue Apr 3, 2019 · 0 comments
Open

Expand tests to improve code coverage #4

JeanMertz opened this issue Apr 3, 2019 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@JeanMertz
Copy link
Member

There's currently a single test, to validate the render function:

bulletin/src/main.rs

Lines 116 to 132 in e16f06e

#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_render() {
let template = "{{ posts[0].href }}";
let mut posts = vec![Post::default()];
posts[0].href = "foo".to_owned();
let data = Data { posts };
let result = render(template, data);
assert!(result.is_ok());
assert_eq!(result.unwrap(), "foo".to_owned());
}
}

It would be nice if we could expand this to cover some more functionality, even though I realise there's not much to the complexity of this library, it can still be a nice learning experience to add more tests to the project.

@JeanMertz JeanMertz added enhancement New feature or request help wanted Extra attention is needed labels Apr 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

1 participant