Prepare Gotcha 1.0 for release

This commit is contained in:
Georg Bauer
2026-08-03 17:54:07 +02:00
parent 1c4a6efd13
commit 46cca8fdd2
60 changed files with 7916 additions and 7173 deletions

View File

@@ -463,50 +463,4 @@ impl Args {
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn parses_server_selection_and_repository_scope() {
let args = Args::parse(
["--server", "work", "repo", "show"].map(str::to_owned),
None,
)
.unwrap();
let repository = RepositoryScope::parse("alice/project").unwrap();
assert_eq!(args.server.as_deref(), Some("work"));
assert_eq!(args.command, ["repo", "show"]);
assert_eq!(
(repository.owner.as_str(), repository.repository.as_str()),
("alice", "project")
);
assert_eq!(requested_help(&[]).unwrap(), Some(ROOT_HELP));
assert_eq!(requested_help(&["repo".into()]).unwrap(), Some(REPO_HELP));
assert!(
requested_help(&["repo".into(), "show".into(), "--help".into()])
.unwrap()
.unwrap()
.starts_with("Usage: gotcha repo show")
);
}
#[test]
fn formats_bounded_aligned_tables_without_tabs() {
let table = format_table(
&[("INDEX", 8), ("STATE", 10), ("TITLE", 60)],
&[vec![
"22".into(),
"open".into(),
"A deliberately long issue title that must be shortened".into(),
]],
40,
);
assert!(!table.contains('\t'));
assert!(table.contains('…'));
assert_eq!(table.lines().count(), 3);
assert!(table.lines().all(|line| line.chars().count() <= 40));
assert!(table.lines().next().unwrap().starts_with("INDEX STATE"));
}
}
mod tests;