Compare commits

..

No commits in common. "a37b4cc72b51d59d9aacc363f9d5c3cbd9e480e1" and "6b27a560e3c484ae8ec9044a5587b0d083ab2b06" have entirely different histories.

25 changed files with 34 additions and 43 deletions

View file

@ -7,9 +7,6 @@ edition = "2024"
default = []
log = ["dep:log", "dep:simple_logger"]
[dev-dependencies]
pretty_assertions = "1.4.1"
[dependencies]
anyhow = "1.0.95"
chrono = "0.4.41"

View file

@ -208,21 +208,19 @@ impl Comment {
#[cfg(test)]
mod tests {
use super::*;
use pretty_assertions::assert_eq;
#[test]
fn read_comment_0() {
let comment_dir = std::path::Path::new(
"test/0001/dd79c8cfb8beeacd0460429944b4ecbe/comments/9055dac36045fe36545bed7ae7b49347",
);
let comment_dir =
std::path::Path::new("test/0001/dd79c8cfb8beeacd0460429944b4ecbe95a31561/comments/9055dac36045fe36545bed7ae7b49347");
let comment = Comment::new_from_dir(comment_dir).unwrap();
let expected = Comment {
uuid: String::from("9055dac36045fe36545bed7ae7b49347"),
author: String::from("Sebastian Kuzminsky <seb@highlab.com>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T10:08:38-06:00")
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-07T15:26:26-06:00")
.unwrap()
.with_timezone(&chrono::Local),
description: String::from("This is a comment on issue dd79c8cfb8beeacd0460429944b4ecbe\n\nIt has multiple lines\n"),
description: String::from("This is a comment on issue dd79c8cfb8beeacd0460429944b4ecbe95a31561\n\nIt has multiple lines\n"),
dir: std::path::PathBuf::from(comment_dir),
};
assert_eq!(comment, expected);

View file

@ -502,7 +502,6 @@ fn create_orphan_branch_at_path(
#[cfg(test)]
mod tests {
use super::*;
use pretty_assertions::assert_eq;
#[test]
fn test_worktree() {

View file

@ -143,7 +143,6 @@ impl Issue {
.filter(|s| s.len() > 0)
.map(|tag| String::from(tag.trim()))
.collect();
tags.sort();
} else if file_name == "comments" && direntry.metadata()?.is_dir() {
Self::read_comments(&mut comments, &direntry.path())?;
} else {
@ -549,23 +548,22 @@ impl Issue {
#[cfg(test)]
mod tests {
use super::*;
use pretty_assertions::assert_eq;
#[test]
fn read_issue_0() {
let issue_dir = std::path::Path::new("test/0000/3943fc5c173fdf41c0a22251593cd476/");
let issue_dir = std::path::Path::new("test/0000/3943fc5c173fdf41c0a22251593cd476d96e6c9f/");
let issue = Issue::new_from_dir(issue_dir).unwrap();
let expected = Issue {
id: String::from("3943fc5c173fdf41c0a22251593cd476"),
id: String::from("3943fc5c173fdf41c0a22251593cd476d96e6c9f"),
author: String::from("Sebastian Kuzminsky <seb@highlab.com>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T08:36:25-06:00")
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-03T12:14:26-06:00")
.unwrap()
.with_timezone(&chrono::Local),
done_time: None,
tags: Vec::<String>::from([
String::from("tag1"),
String::from("TAG2"),
String::from("i-am-also-a-tag"),
String::from("tag1"),
]),
state: State::New,
dependencies: None,
@ -581,12 +579,12 @@ mod tests {
#[test]
fn read_issue_1() {
let issue_dir = std::path::Path::new("test/0000/7792b063eef6d33e7da5dc1856750c14/");
let issue_dir = std::path::Path::new("test/0000/7792b063eef6d33e7da5dc1856750c149ba678c6/");
let issue = Issue::new_from_dir(issue_dir).unwrap();
let expected = Issue {
id: String::from("7792b063eef6d33e7da5dc1856750c14"),
id: String::from("7792b063eef6d33e7da5dc1856750c149ba678c6"),
author: String::from("Sebastian Kuzminsky <seb@highlab.com>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T08:37:07-06:00")
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-03T12:14:26-06:00")
.unwrap()
.with_timezone(&chrono::Local),
done_time: None,

View file

@ -87,7 +87,6 @@ impl Issues {
#[cfg(test)]
mod tests {
use super::*;
use pretty_assertions::assert_eq;
#[test]
fn read_issues_0000() {
@ -96,13 +95,13 @@ mod tests {
let mut expected = Issues::new();
let uuid = String::from("7792b063eef6d33e7da5dc1856750c14");
let uuid = String::from("7792b063eef6d33e7da5dc1856750c149ba678c6");
let mut dir = std::path::PathBuf::from(issues_dir);
dir.push(&uuid);
expected.add_issue(crate::issue::Issue {
id: uuid,
author: String::from("Sebastian Kuzminsky <seb@highlab.com>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T08:37:07-06:00")
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-03T12:14:26-06:00")
.unwrap()
.with_timezone(&chrono::Local),
done_time: None,
@ -115,21 +114,21 @@ mod tests {
dir,
});
let uuid = String::from("3943fc5c173fdf41c0a22251593cd476");
let uuid = String::from("3943fc5c173fdf41c0a22251593cd476d96e6c9f");
let mut dir = std::path::PathBuf::from(issues_dir);
dir.push(&uuid);
expected.add_issue(
crate::issue::Issue {
id: uuid,
author: String::from("Sebastian Kuzminsky <seb@highlab.com>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T08:36:25-06:00")
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-03T12:14:26-06:00")
.unwrap()
.with_timezone(&chrono::Local),
done_time: None,
tags: Vec::<String>::from([
String::from("TAG2"),
String::from("i-am-also-a-tag"),
String::from("tag1"),
String::from("TAG2"),
String::from("i-am-also-a-tag")
]),
state: crate::issue::State::New,
dependencies: None,
@ -149,13 +148,13 @@ mod tests {
let mut expected = Issues::new();
let uuid = String::from("3fa5bfd93317ad25772680071d5ac325");
let uuid = String::from("3fa5bfd93317ad25772680071d5ac3259cd2384f");
let mut dir = std::path::PathBuf::from(issues_dir);
dir.push(&uuid);
expected.add_issue(crate::issue::Issue {
id: uuid,
author: String::from("Sebastian Kuzminsky <seb@highlab.com>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T08:37:46-06:00")
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-03T11:59:44-06:00")
.unwrap()
.with_timezone(&chrono::Local),
done_time: Some(
@ -172,7 +171,7 @@ mod tests {
dir,
});
let uuid = String::from("dd79c8cfb8beeacd0460429944b4ecbe");
let uuid = String::from("dd79c8cfb8beeacd0460429944b4ecbe95a31561");
let mut dir = std::path::PathBuf::from(issues_dir);
dir.push(&uuid);
let mut comment_dir = dir.clone();
@ -184,8 +183,8 @@ mod tests {
crate::comment::Comment {
uuid: comment_uuid,
author: String::from("Sebastian Kuzminsky <seb@highlab.com>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T10:08:38-06:00").unwrap().with_timezone(&chrono::Local),
description: String::from("This is a comment on issue dd79c8cfb8beeacd0460429944b4ecbe\n\nIt has multiple lines\n"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-07T15:26:26-06:00").unwrap().with_timezone(&chrono::Local),
description: String::from("This is a comment on issue dd79c8cfb8beeacd0460429944b4ecbe95a31561\n\nIt has multiple lines\n"),
dir: std::path::PathBuf::from(comment_dir),
}
);
@ -193,7 +192,7 @@ mod tests {
crate::issue::Issue {
id: uuid,
author: String::from("Sebastian Kuzminsky <seb@highlab.com>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T10:08:24-06:00")
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-03T11:59:44-06:00")
.unwrap()
.with_timezone(&chrono::Local),
done_time: None,
@ -216,13 +215,13 @@ mod tests {
let mut expected = Issues::new();
let uuid = String::from("3fa5bfd93317ad25772680071d5ac325");
let uuid = String::from("3fa5bfd93317ad25772680071d5ac3259cd2384f");
let mut dir = std::path::PathBuf::from(issues_dir);
dir.push(&uuid);
expected.add_issue(crate::issue::Issue {
id: uuid,
author: String::from("sigil-03 <sigil@glyphs.tech>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T08:38:40-06:00")
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-05T13:55:49-06:00")
.unwrap()
.with_timezone(&chrono::Local),
done_time: None,
@ -235,14 +234,14 @@ mod tests {
dir,
});
let uuid = String::from("dd79c8cfb8beeacd0460429944b4ecbe");
let uuid = String::from("dd79c8cfb8beeacd0460429944b4ecbe95a31561");
let mut dir = std::path::PathBuf::from(issues_dir);
dir.push(&uuid);
expected.add_issue(
crate::issue::Issue {
id: uuid,
author: String::from("sigil-03 <sigil@glyphs.tech>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T08:39:20-06:00")
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-05T13:55:49-06:00")
.unwrap()
.with_timezone(&chrono::Local),
done_time: None,
@ -256,22 +255,22 @@ mod tests {
},
);
let uuid = String::from("a85f81fc5f14cb5d4851dd445dc9744c");
let uuid = String::from("a85f81fc5f14cb5d4851dd445dc9744c7f16ccc7");
let mut dir = std::path::PathBuf::from(issues_dir);
dir.push(&uuid);
expected.add_issue(
crate::issue::Issue {
id: uuid,
author: String::from("sigil-03 <sigil@glyphs.tech>"),
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-24T08:39:02-06:00")
creation_time: chrono::DateTime::parse_from_rfc3339("2025-07-05T13:55:49-06:00")
.unwrap()
.with_timezone(&chrono::Local),
done_time: None,
tags: Vec::<String>::new(),
state: crate::issue::State::WontDo,
dependencies: Some(vec![
crate::issue::IssueHandle::from("3fa5bfd93317ad25772680071d5ac325"),
crate::issue::IssueHandle::from("dd79c8cfb8beeacd0460429944b4ecbe"),
crate::issue::IssueHandle::from("3fa5bfd93317ad25772680071d5ac3259cd2384f"),
crate::issue::IssueHandle::from("dd79c8cfb8beeacd0460429944b4ecbe95a31561"),
]),
assignee: None,
description: String::from("issue with dependencies\n\na test has begun\nfor dependencies we seek\nintertwining life"),

View file

@ -1,3 +0,0 @@
This is a comment on issue dd79c8cfb8beeacd0460429944b4ecbe
It has multiple lines

View file

@ -0,0 +1,3 @@
This is a comment on issue dd79c8cfb8beeacd0460429944b4ecbe95a31561
It has multiple lines