mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-23 05:27:47 +02:00
refactor to a library, add integration tests
This commit is contained in:
parent
9f310c76bd
commit
d0744d5178
8 changed files with 56 additions and 59 deletions
23
tests/parse.rs
Normal file
23
tests/parse.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
extern crate taskwarrior;
|
||||
extern crate chrono;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::BufReader;
|
||||
use chrono::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn test_parse() {
|
||||
let filename = "tests/data/tdb2-test.data";
|
||||
let file = File::open(filename).unwrap();
|
||||
let tasks = taskwarrior::parse(filename, BufReader::new(file)).unwrap();
|
||||
assert_eq!(
|
||||
tasks[0].description,
|
||||
"https://phabricator.services.example.com/D7364 [taskgraph] Download debian packages"
|
||||
);
|
||||
assert_eq!(tasks[0].entry, Utc.timestamp(1538520624, 0));
|
||||
assert_eq!(tasks[0].udas.get("phabricatorid").unwrap(), "D7364");
|
||||
assert_eq!(tasks[1].annotations[0].entry, Utc.timestamp(1541461824, 0));
|
||||
assert!(tasks[1].annotations[0].description.starts_with(
|
||||
"https://github.com",
|
||||
));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue