mirror of
https://github.com/Hopiu/lychee.git
synced 2026-03-16 20:50:25 +00:00
display unsupported URLs (#1727)
* display status for unsupported URLs * updates screengrab --------- Co-authored-by: Allen Hernandez <2349718+AllenSH12@users.noreply.github.com>
This commit is contained in:
parent
b970256248
commit
bbfb8b0b96
4 changed files with 27352 additions and 20 deletions
27326
assets/screencast.svg
27326
assets/screencast.svg
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 953 KiB After Width: | Height: | Size: 1.6 MiB |
|
|
@ -80,6 +80,7 @@ impl Display for CompactResponseStats {
|
|||
write_if_any(stats.unknown, "❓", "Unknown", &BOLD_PINK, f)?;
|
||||
write_if_any(stats.excludes, "👻", "Excluded", &BOLD_YELLOW, f)?;
|
||||
write_if_any(stats.timeouts, "⏳", "Timeouts", &BOLD_YELLOW, f)?;
|
||||
write_if_any(stats.unsupported, "⛔", "Unsupported", &BOLD_YELLOW, f)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ impl Display for DetailedResponseStats {
|
|||
write_stat(f, "\u{1f500} Redirected", stats.redirects, true)?; // 🔀
|
||||
write_stat(f, "\u{1f47b} Excluded", stats.excludes, true)?; // 👻
|
||||
write_stat(f, "\u{2753} Unknown", stats.unknown, true)?; //❓
|
||||
write_stat(f, "\u{1f6ab} Errors", stats.errors, false)?; // 🚫
|
||||
write_stat(f, "\u{1f6ab} Errors", stats.errors, true)?; // 🚫
|
||||
write_stat(f, "\u{26d4} Unsupported", stats.errors, false)?; // ⛔
|
||||
|
||||
let response_formatter = get_response_formatter(&self.mode);
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,10 @@ fn stats_table(stats: &ResponseStats) -> String {
|
|||
status: "\u{1f6ab} Errors",
|
||||
count: stats.errors,
|
||||
},
|
||||
StatsTableEntry {
|
||||
status: "\u{26d4} Unsupported",
|
||||
count: stats.unsupported,
|
||||
},
|
||||
];
|
||||
let style = Style::markdown();
|
||||
|
||||
|
|
@ -196,15 +200,16 @@ mod tests {
|
|||
fn test_render_stats() {
|
||||
let stats = ResponseStats::default();
|
||||
let table = stats_table(&stats);
|
||||
let expected = "| Status | Count |
|
||||
|---------------|-------|
|
||||
| 🔍 Total | 0 |
|
||||
| ✅ Successful | 0 |
|
||||
| ⏳ Timeouts | 0 |
|
||||
| 🔀 Redirected | 0 |
|
||||
| 👻 Excluded | 0 |
|
||||
| ❓ Unknown | 0 |
|
||||
| 🚫 Errors | 0 |";
|
||||
let expected = "| Status | Count |
|
||||
|----------------|-------|
|
||||
| 🔍 Total | 0 |
|
||||
| ✅ Successful | 0 |
|
||||
| ⏳ Timeouts | 0 |
|
||||
| 🔀 Redirected | 0 |
|
||||
| 👻 Excluded | 0 |
|
||||
| ❓ Unknown | 0 |
|
||||
| 🚫 Errors | 0 |
|
||||
| ⛔ Unsupported | 0 |";
|
||||
assert_eq!(table, expected.to_string());
|
||||
}
|
||||
|
||||
|
|
@ -228,15 +233,16 @@ mod tests {
|
|||
let summary = MarkdownResponseStats(stats);
|
||||
let expected = "# Summary
|
||||
|
||||
| Status | Count |
|
||||
|---------------|-------|
|
||||
| 🔍 Total | 1 |
|
||||
| ✅ Successful | 0 |
|
||||
| ⏳ Timeouts | 0 |
|
||||
| 🔀 Redirected | 0 |
|
||||
| 👻 Excluded | 0 |
|
||||
| ❓ Unknown | 0 |
|
||||
| 🚫 Errors | 1 |
|
||||
| Status | Count |
|
||||
|----------------|-------|
|
||||
| 🔍 Total | 1 |
|
||||
| ✅ Successful | 0 |
|
||||
| ⏳ Timeouts | 0 |
|
||||
| 🔀 Redirected | 0 |
|
||||
| 👻 Excluded | 0 |
|
||||
| ❓ Unknown | 0 |
|
||||
| 🚫 Errors | 1 |
|
||||
| ⛔ Unsupported | 0 |
|
||||
|
||||
## Errors per input
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue