This repository was archived by the owner on Aug 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Expand tests to improve code coverage #4
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
There's currently a single test, to validate the render function:
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed