From 312c8ef01f1a80f4a806629a7dacd32508b267a5 Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Mon, 7 Feb 2022 19:48:57 +0000 Subject: [PATCH] Add new `--style` called `header-filesize` and display it by default (#1988) Also rename `header` to `header-filename`. Related to #1701 --- CHANGELOG.md | 2 + Cargo.lock | 7 ++ Cargo.toml | 1 + src/bin/bat/clap_app.rs | 20 +++- src/input.rs | 9 +- src/printer.rs | 104 ++++++++++++------ src/style.rs | 22 +++- .../many-small-files/small-file-0.txt | 1 + .../many-small-files/small-file-1.txt | 1 + .../many-small-files/small-file-10.txt | 1 + .../many-small-files/small-file-100.txt | 1 + .../many-small-files/small-file-11.txt | 1 + .../many-small-files/small-file-12.txt | 1 + .../many-small-files/small-file-13.txt | 1 + .../many-small-files/small-file-14.txt | 1 + .../many-small-files/small-file-15.txt | 1 + .../many-small-files/small-file-16.txt | 1 + .../many-small-files/small-file-17.txt | 1 + .../many-small-files/small-file-18.txt | 1 + .../many-small-files/small-file-19.txt | 1 + .../many-small-files/small-file-2.txt | 1 + .../many-small-files/small-file-20.txt | 1 + .../many-small-files/small-file-21.txt | 1 + .../many-small-files/small-file-22.txt | 1 + .../many-small-files/small-file-23.txt | 1 + .../many-small-files/small-file-24.txt | 1 + .../many-small-files/small-file-25.txt | 1 + .../many-small-files/small-file-26.txt | 1 + .../many-small-files/small-file-27.txt | 1 + .../many-small-files/small-file-28.txt | 1 + .../many-small-files/small-file-29.txt | 1 + .../many-small-files/small-file-3.txt | 1 + .../many-small-files/small-file-30.txt | 1 + .../many-small-files/small-file-31.txt | 1 + .../many-small-files/small-file-32.txt | 1 + .../many-small-files/small-file-33.txt | 1 + .../many-small-files/small-file-34.txt | 1 + .../many-small-files/small-file-35.txt | 1 + .../many-small-files/small-file-36.txt | 1 + .../many-small-files/small-file-37.txt | 1 + .../many-small-files/small-file-38.txt | 1 + .../many-small-files/small-file-39.txt | 1 + .../many-small-files/small-file-4.txt | 1 + .../many-small-files/small-file-40.txt | 1 + .../many-small-files/small-file-41.txt | 1 + .../many-small-files/small-file-42.txt | 1 + .../many-small-files/small-file-43.txt | 1 + .../many-small-files/small-file-44.txt | 1 + .../many-small-files/small-file-45.txt | 1 + .../many-small-files/small-file-46.txt | 1 + .../many-small-files/small-file-47.txt | 1 + .../many-small-files/small-file-48.txt | 1 + .../many-small-files/small-file-49.txt | 1 + .../many-small-files/small-file-5.txt | 1 + .../many-small-files/small-file-50.txt | 1 + .../many-small-files/small-file-51.txt | 1 + .../many-small-files/small-file-52.txt | 1 + .../many-small-files/small-file-53.txt | 1 + .../many-small-files/small-file-54.txt | 1 + .../many-small-files/small-file-55.txt | 1 + .../many-small-files/small-file-56.txt | 1 + .../many-small-files/small-file-57.txt | 1 + .../many-small-files/small-file-58.txt | 1 + .../many-small-files/small-file-59.txt | 1 + .../many-small-files/small-file-6.txt | 1 + .../many-small-files/small-file-60.txt | 1 + .../many-small-files/small-file-61.txt | 1 + .../many-small-files/small-file-62.txt | 1 + .../many-small-files/small-file-63.txt | 1 + .../many-small-files/small-file-64.txt | 1 + .../many-small-files/small-file-65.txt | 1 + .../many-small-files/small-file-66.txt | 1 + .../many-small-files/small-file-67.txt | 1 + .../many-small-files/small-file-68.txt | 1 + .../many-small-files/small-file-69.txt | 1 + .../many-small-files/small-file-7.txt | 1 + .../many-small-files/small-file-70.txt | 1 + .../many-small-files/small-file-71.txt | 1 + .../many-small-files/small-file-72.txt | 1 + .../many-small-files/small-file-73.txt | 1 + .../many-small-files/small-file-74.txt | 1 + .../many-small-files/small-file-75.txt | 1 + .../many-small-files/small-file-76.txt | 1 + .../many-small-files/small-file-77.txt | 1 + .../many-small-files/small-file-78.txt | 1 + .../many-small-files/small-file-79.txt | 1 + .../many-small-files/small-file-8.txt | 1 + .../many-small-files/small-file-80.txt | 1 + .../many-small-files/small-file-81.txt | 1 + .../many-small-files/small-file-82.txt | 1 + .../many-small-files/small-file-83.txt | 1 + .../many-small-files/small-file-84.txt | 1 + .../many-small-files/small-file-85.txt | 1 + .../many-small-files/small-file-86.txt | 1 + .../many-small-files/small-file-87.txt | 1 + .../many-small-files/small-file-88.txt | 1 + .../many-small-files/small-file-89.txt | 1 + .../many-small-files/small-file-9.txt | 1 + .../many-small-files/small-file-90.txt | 1 + .../many-small-files/small-file-91.txt | 1 + .../many-small-files/small-file-92.txt | 1 + .../many-small-files/small-file-93.txt | 1 + .../many-small-files/small-file-94.txt | 1 + .../many-small-files/small-file-95.txt | 1 + .../many-small-files/small-file-96.txt | 1 + .../many-small-files/small-file-97.txt | 1 + .../many-small-files/small-file-98.txt | 1 + .../many-small-files/small-file-99.txt | 1 + tests/benchmarks/run-benchmarks.sh | 10 ++ tests/integration_tests.rs | 67 ++++++++++- tests/snapshots/output/full.snapshot.txt | 1 + 111 files changed, 302 insertions(+), 42 deletions(-) create mode 100644 tests/benchmarks/many-small-files/small-file-0.txt create mode 100644 tests/benchmarks/many-small-files/small-file-1.txt create mode 100644 tests/benchmarks/many-small-files/small-file-10.txt create mode 100644 tests/benchmarks/many-small-files/small-file-100.txt create mode 100644 tests/benchmarks/many-small-files/small-file-11.txt create mode 100644 tests/benchmarks/many-small-files/small-file-12.txt create mode 100644 tests/benchmarks/many-small-files/small-file-13.txt create mode 100644 tests/benchmarks/many-small-files/small-file-14.txt create mode 100644 tests/benchmarks/many-small-files/small-file-15.txt create mode 100644 tests/benchmarks/many-small-files/small-file-16.txt create mode 100644 tests/benchmarks/many-small-files/small-file-17.txt create mode 100644 tests/benchmarks/many-small-files/small-file-18.txt create mode 100644 tests/benchmarks/many-small-files/small-file-19.txt create mode 100644 tests/benchmarks/many-small-files/small-file-2.txt create mode 100644 tests/benchmarks/many-small-files/small-file-20.txt create mode 100644 tests/benchmarks/many-small-files/small-file-21.txt create mode 100644 tests/benchmarks/many-small-files/small-file-22.txt create mode 100644 tests/benchmarks/many-small-files/small-file-23.txt create mode 100644 tests/benchmarks/many-small-files/small-file-24.txt create mode 100644 tests/benchmarks/many-small-files/small-file-25.txt create mode 100644 tests/benchmarks/many-small-files/small-file-26.txt create mode 100644 tests/benchmarks/many-small-files/small-file-27.txt create mode 100644 tests/benchmarks/many-small-files/small-file-28.txt create mode 100644 tests/benchmarks/many-small-files/small-file-29.txt create mode 100644 tests/benchmarks/many-small-files/small-file-3.txt create mode 100644 tests/benchmarks/many-small-files/small-file-30.txt create mode 100644 tests/benchmarks/many-small-files/small-file-31.txt create mode 100644 tests/benchmarks/many-small-files/small-file-32.txt create mode 100644 tests/benchmarks/many-small-files/small-file-33.txt create mode 100644 tests/benchmarks/many-small-files/small-file-34.txt create mode 100644 tests/benchmarks/many-small-files/small-file-35.txt create mode 100644 tests/benchmarks/many-small-files/small-file-36.txt create mode 100644 tests/benchmarks/many-small-files/small-file-37.txt create mode 100644 tests/benchmarks/many-small-files/small-file-38.txt create mode 100644 tests/benchmarks/many-small-files/small-file-39.txt create mode 100644 tests/benchmarks/many-small-files/small-file-4.txt create mode 100644 tests/benchmarks/many-small-files/small-file-40.txt create mode 100644 tests/benchmarks/many-small-files/small-file-41.txt create mode 100644 tests/benchmarks/many-small-files/small-file-42.txt create mode 100644 tests/benchmarks/many-small-files/small-file-43.txt create mode 100644 tests/benchmarks/many-small-files/small-file-44.txt create mode 100644 tests/benchmarks/many-small-files/small-file-45.txt create mode 100644 tests/benchmarks/many-small-files/small-file-46.txt create mode 100644 tests/benchmarks/many-small-files/small-file-47.txt create mode 100644 tests/benchmarks/many-small-files/small-file-48.txt create mode 100644 tests/benchmarks/many-small-files/small-file-49.txt create mode 100644 tests/benchmarks/many-small-files/small-file-5.txt create mode 100644 tests/benchmarks/many-small-files/small-file-50.txt create mode 100644 tests/benchmarks/many-small-files/small-file-51.txt create mode 100644 tests/benchmarks/many-small-files/small-file-52.txt create mode 100644 tests/benchmarks/many-small-files/small-file-53.txt create mode 100644 tests/benchmarks/many-small-files/small-file-54.txt create mode 100644 tests/benchmarks/many-small-files/small-file-55.txt create mode 100644 tests/benchmarks/many-small-files/small-file-56.txt create mode 100644 tests/benchmarks/many-small-files/small-file-57.txt create mode 100644 tests/benchmarks/many-small-files/small-file-58.txt create mode 100644 tests/benchmarks/many-small-files/small-file-59.txt create mode 100644 tests/benchmarks/many-small-files/small-file-6.txt create mode 100644 tests/benchmarks/many-small-files/small-file-60.txt create mode 100644 tests/benchmarks/many-small-files/small-file-61.txt create mode 100644 tests/benchmarks/many-small-files/small-file-62.txt create mode 100644 tests/benchmarks/many-small-files/small-file-63.txt create mode 100644 tests/benchmarks/many-small-files/small-file-64.txt create mode 100644 tests/benchmarks/many-small-files/small-file-65.txt create mode 100644 tests/benchmarks/many-small-files/small-file-66.txt create mode 100644 tests/benchmarks/many-small-files/small-file-67.txt create mode 100644 tests/benchmarks/many-small-files/small-file-68.txt create mode 100644 tests/benchmarks/many-small-files/small-file-69.txt create mode 100644 tests/benchmarks/many-small-files/small-file-7.txt create mode 100644 tests/benchmarks/many-small-files/small-file-70.txt create mode 100644 tests/benchmarks/many-small-files/small-file-71.txt create mode 100644 tests/benchmarks/many-small-files/small-file-72.txt create mode 100644 tests/benchmarks/many-small-files/small-file-73.txt create mode 100644 tests/benchmarks/many-small-files/small-file-74.txt create mode 100644 tests/benchmarks/many-small-files/small-file-75.txt create mode 100644 tests/benchmarks/many-small-files/small-file-76.txt create mode 100644 tests/benchmarks/many-small-files/small-file-77.txt create mode 100644 tests/benchmarks/many-small-files/small-file-78.txt create mode 100644 tests/benchmarks/many-small-files/small-file-79.txt create mode 100644 tests/benchmarks/many-small-files/small-file-8.txt create mode 100644 tests/benchmarks/many-small-files/small-file-80.txt create mode 100644 tests/benchmarks/many-small-files/small-file-81.txt create mode 100644 tests/benchmarks/many-small-files/small-file-82.txt create mode 100644 tests/benchmarks/many-small-files/small-file-83.txt create mode 100644 tests/benchmarks/many-small-files/small-file-84.txt create mode 100644 tests/benchmarks/many-small-files/small-file-85.txt create mode 100644 tests/benchmarks/many-small-files/small-file-86.txt create mode 100644 tests/benchmarks/many-small-files/small-file-87.txt create mode 100644 tests/benchmarks/many-small-files/small-file-88.txt create mode 100644 tests/benchmarks/many-small-files/small-file-89.txt create mode 100644 tests/benchmarks/many-small-files/small-file-9.txt create mode 100644 tests/benchmarks/many-small-files/small-file-90.txt create mode 100644 tests/benchmarks/many-small-files/small-file-91.txt create mode 100644 tests/benchmarks/many-small-files/small-file-92.txt create mode 100644 tests/benchmarks/many-small-files/small-file-93.txt create mode 100644 tests/benchmarks/many-small-files/small-file-94.txt create mode 100644 tests/benchmarks/many-small-files/small-file-95.txt create mode 100644 tests/benchmarks/many-small-files/small-file-96.txt create mode 100644 tests/benchmarks/many-small-files/small-file-97.txt create mode 100644 tests/benchmarks/many-small-files/small-file-98.txt create mode 100644 tests/benchmarks/many-small-files/small-file-99.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 97bc6e7b2d..ae73464145 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Features +- New style component `header-filesize` to show size of the displayed file in the header. See #1988 (@mdibaiee) + ## Bugfixes ## Other diff --git a/Cargo.lock b/Cargo.lock index 4d8fecb172..4c17fd9026 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,6 +82,7 @@ dependencies = [ "atty", "bincode", "bugreport", + "bytesize", "clap", "clircle", "console", @@ -169,6 +170,12 @@ version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" +[[package]] +name = "bytesize" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70" + [[package]] name = "cc" version = "1.0.72" diff --git a/Cargo.toml b/Cargo.toml index 639e9d9656..99a6564289 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,6 +65,7 @@ dirs-next = { version = "2.0.0", optional = true } grep-cli = { version = "0.1.6", optional = true } regex = { version = "1.0", optional = true } walkdir = { version = "2.0", optional = true } +bytesize = { version = "1.1.0" } [dependencies.git2] version = "0.13" diff --git a/src/bin/bat/clap_app.rs b/src/bin/bat/clap_app.rs index e0460f7482..0a1a81cf8c 100644 --- a/src/bin/bat/clap_app.rs +++ b/src/bin/bat/clap_app.rs @@ -396,11 +396,19 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .validator(|val| { let mut invalid_vals = val.split(',').filter(|style| { !&[ - "auto", "full", "plain", "header", "grid", "rule", "numbers", "snip", + "auto", + "full", + "plain", + "header", + "header-filename", + "header-filesize", + "grid", + "rule", + "numbers", + "snip", #[cfg(feature = "git")] - "changes", - ] - .contains(style) + "changes", + ].contains(style) }); if let Some(invalid) = invalid_vals.next() { @@ -426,7 +434,9 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { * auto: same as 'full', unless the output is piped.\n \ * plain: disables all available components.\n \ * changes: show Git modification markers.\n \ - * header: show filenames before the content.\n \ + * header: alias for 'header-filename'.\n \ + * header-filename: show filenames before the content.\n \ + * header-filesize: show file sizes before the content.\n \ * grid: vertical/horizontal lines to separate side bar\n \ and the header from the content.\n \ * rule: horizontal lines to delimit files.\n \ diff --git a/src/input.rs b/src/input.rs index ffaca0ae0b..3c295822db 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,4 +1,5 @@ use std::convert::TryFrom; +use std::fs; use std::fs::File; use std::io::{self, BufRead, BufReader, Read}; use std::path::{Path, PathBuf}; @@ -87,6 +88,7 @@ impl<'a> InputKind<'a> { #[derive(Clone, Default)] pub(crate) struct InputMetadata { pub(crate) user_provided_name: Option, + pub(crate) size: Option, } pub struct Input<'a> { @@ -130,9 +132,14 @@ impl<'a> Input<'a> { fn _ordinary_file(path: &Path) -> Self { let kind = InputKind::OrdinaryFile(path.to_path_buf()); + let metadata = InputMetadata { + size: fs::metadata(path).map(|m| m.len()).ok(), + ..InputMetadata::default() + }; + Input { description: kind.description(), - metadata: InputMetadata::default(), + metadata, kind, } } diff --git a/src/printer.rs b/src/printer.rs index 6b8cbc3a64..2c70421d14 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -4,6 +4,8 @@ use std::vec::Vec; use ansi_term::Colour::{Fixed, Green, Red, Yellow}; use ansi_term::Style; +use bytesize::ByteSize; + use console::AnsiCodeIterator; use syntect::easy::HighlightLines; @@ -29,6 +31,7 @@ use crate::error::*; use crate::input::OpenedInput; use crate::line_range::RangeCheckResult; use crate::preprocessor::{expand_tabs, replace_nonprintable}; +use crate::style::StyleComponent; use crate::terminal::{as_terminal_escaped, to_ansi_color}; use crate::vscreen::AnsiStyle; use crate::wrapping::WrappingMode; @@ -250,6 +253,21 @@ impl<'a> InteractivePrinter<'a> { } } + fn print_header_component_indent(&mut self, handle: &mut dyn Write) -> std::io::Result<()> { + if self.config.style_components.grid() { + write!( + handle, + "{}{}", + " ".repeat(self.panel_width), + self.colors + .grid + .paint(if self.panel_width > 0 { "│ " } else { "" }), + ) + } else { + write!(handle, "{}", " ".repeat(self.panel_width)) + } + } + fn preprocess(&self, text: &str, cursor: &mut usize) -> String { if self.config.tab_width > 0 { return expand_tabs(text, self.config.tab_width, cursor); @@ -287,25 +305,6 @@ impl<'a> Printer for InteractivePrinter<'a> { return Ok(()); } - if self.config.style_components.grid() { - self.print_horizontal_line(handle, '┬')?; - - write!( - handle, - "{}{}", - " ".repeat(self.panel_width), - self.colors - .grid - .paint(if self.panel_width > 0 { "│ " } else { "" }), - )?; - } else { - // Only pad space between files, if we haven't already drawn a horizontal rule - if add_header_padding && !self.config.style_components.rule() { - writeln!(handle)?; - } - write!(handle, "{}", " ".repeat(self.panel_width))?; - } - let mode = match self.content_type { Some(ContentType::BINARY) => " ", Some(ContentType::UTF_16LE) => " ", @@ -315,17 +314,60 @@ impl<'a> Printer for InteractivePrinter<'a> { }; let description = &input.description; + let metadata = &input.metadata; + + // We use this iterator to have a deterministic order for + // header components. HashSet has arbitrary order, but Vec is ordered. + let header_components: Vec = [ + ( + StyleComponent::HeaderFilename, + self.config.style_components.header_filename(), + ), + ( + StyleComponent::HeaderFilesize, + self.config.style_components.header_filesize(), + ), + ] + .iter() + .filter(|(_, is_enabled)| *is_enabled) + .map(|(component, _)| *component) + .collect(); + + // Print the cornering grid before the first header component + if self.config.style_components.grid() { + self.print_horizontal_line(handle, '┬')?; + } else { + // Only pad space between files, if we haven't already drawn a horizontal rule + if add_header_padding && !self.config.style_components.rule() { + writeln!(handle)?; + } + } - writeln!( - handle, - "{}{}{}", - description - .kind() - .map(|kind| format!("{}: ", kind)) - .unwrap_or_else(|| "".into()), - self.colors.filename.paint(description.title()), - mode - )?; + header_components.iter().try_for_each(|component| { + self.print_header_component_indent(handle)?; + + match component { + StyleComponent::HeaderFilename => writeln!( + handle, + "{}{}{}", + description + .kind() + .map(|kind| format!("{}: ", kind)) + .unwrap_or_else(|| "".into()), + self.colors.header_value.paint(description.title()), + mode + ), + + StyleComponent::HeaderFilesize => { + let bsize = metadata + .size + .map(|s| format!("{}", ByteSize(s))) + .unwrap_or_else(|| "-".into()); + writeln!(handle, "Size: {}", self.colors.header_value.paint(bsize)) + } + _ => Ok(()), + } + })?; if self.config.style_components.grid() { if self.content_type.map_or(false, |c| c.is_text()) || self.config.show_nonprintable { @@ -617,7 +659,7 @@ const DEFAULT_GUTTER_COLOR: u8 = 238; pub struct Colors { pub grid: Style, pub rule: Style, - pub filename: Style, + pub header_value: Style, pub git_added: Style, pub git_removed: Style, pub git_modified: Style, @@ -646,7 +688,7 @@ impl Colors { Colors { grid: gutter_style, rule: gutter_style, - filename: Style::new().bold(), + header_value: Style::new().bold(), git_added: Green.normal(), git_removed: Red.normal(), git_modified: Yellow.normal(), diff --git a/src/style.rs b/src/style.rs index 654142068b..1bdcaba1a9 100644 --- a/src/style.rs +++ b/src/style.rs @@ -3,6 +3,7 @@ use std::str::FromStr; use crate::error::*; +#[non_exhaustive] #[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)] pub enum StyleComponent { Auto, @@ -11,6 +12,8 @@ pub enum StyleComponent { Grid, Rule, Header, + HeaderFilename, + HeaderFilesize, LineNumbers, Snip, Full, @@ -31,14 +34,17 @@ impl StyleComponent { StyleComponent::Changes => &[StyleComponent::Changes], StyleComponent::Grid => &[StyleComponent::Grid], StyleComponent::Rule => &[StyleComponent::Rule], - StyleComponent::Header => &[StyleComponent::Header], + StyleComponent::Header => &[StyleComponent::HeaderFilename], + StyleComponent::HeaderFilename => &[StyleComponent::HeaderFilename], + StyleComponent::HeaderFilesize => &[StyleComponent::HeaderFilesize], StyleComponent::LineNumbers => &[StyleComponent::LineNumbers], StyleComponent::Snip => &[StyleComponent::Snip], StyleComponent::Full => &[ #[cfg(feature = "git")] StyleComponent::Changes, StyleComponent::Grid, - StyleComponent::Header, + StyleComponent::HeaderFilename, + StyleComponent::HeaderFilesize, StyleComponent::LineNumbers, StyleComponent::Snip, ], @@ -58,6 +64,8 @@ impl FromStr for StyleComponent { "grid" => Ok(StyleComponent::Grid), "rule" => Ok(StyleComponent::Rule), "header" => Ok(StyleComponent::Header), + "header-filename" => Ok(StyleComponent::HeaderFilename), + "header-filesize" => Ok(StyleComponent::HeaderFilesize), "numbers" => Ok(StyleComponent::LineNumbers), "snip" => Ok(StyleComponent::Snip), "full" => Ok(StyleComponent::Full), @@ -89,7 +97,15 @@ impl StyleComponents { } pub fn header(&self) -> bool { - self.0.contains(&StyleComponent::Header) + self.header_filename() || self.header_filesize() + } + + pub fn header_filename(&self) -> bool { + self.0.contains(&StyleComponent::HeaderFilename) + } + + pub fn header_filesize(&self) -> bool { + self.0.contains(&StyleComponent::HeaderFilesize) } pub fn numbers(&self) -> bool { diff --git a/tests/benchmarks/many-small-files/small-file-0.txt b/tests/benchmarks/many-small-files/small-file-0.txt new file mode 100644 index 0000000000..c37ced692b --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-0.txt @@ -0,0 +1 @@ +I am small file 0 diff --git a/tests/benchmarks/many-small-files/small-file-1.txt b/tests/benchmarks/many-small-files/small-file-1.txt new file mode 100644 index 0000000000..a34435e5f9 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-1.txt @@ -0,0 +1 @@ +I am small file 1 diff --git a/tests/benchmarks/many-small-files/small-file-10.txt b/tests/benchmarks/many-small-files/small-file-10.txt new file mode 100644 index 0000000000..44d0741731 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-10.txt @@ -0,0 +1 @@ +I am small file 10 diff --git a/tests/benchmarks/many-small-files/small-file-100.txt b/tests/benchmarks/many-small-files/small-file-100.txt new file mode 100644 index 0000000000..d0aee2f44d --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-100.txt @@ -0,0 +1 @@ +I am small file 100 diff --git a/tests/benchmarks/many-small-files/small-file-11.txt b/tests/benchmarks/many-small-files/small-file-11.txt new file mode 100644 index 0000000000..5e8b37a383 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-11.txt @@ -0,0 +1 @@ +I am small file 11 diff --git a/tests/benchmarks/many-small-files/small-file-12.txt b/tests/benchmarks/many-small-files/small-file-12.txt new file mode 100644 index 0000000000..ffed221aa6 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-12.txt @@ -0,0 +1 @@ +I am small file 12 diff --git a/tests/benchmarks/many-small-files/small-file-13.txt b/tests/benchmarks/many-small-files/small-file-13.txt new file mode 100644 index 0000000000..bce7798149 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-13.txt @@ -0,0 +1 @@ +I am small file 13 diff --git a/tests/benchmarks/many-small-files/small-file-14.txt b/tests/benchmarks/many-small-files/small-file-14.txt new file mode 100644 index 0000000000..290d2284ef --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-14.txt @@ -0,0 +1 @@ +I am small file 14 diff --git a/tests/benchmarks/many-small-files/small-file-15.txt b/tests/benchmarks/many-small-files/small-file-15.txt new file mode 100644 index 0000000000..2b148c7a6f --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-15.txt @@ -0,0 +1 @@ +I am small file 15 diff --git a/tests/benchmarks/many-small-files/small-file-16.txt b/tests/benchmarks/many-small-files/small-file-16.txt new file mode 100644 index 0000000000..ec88108f66 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-16.txt @@ -0,0 +1 @@ +I am small file 16 diff --git a/tests/benchmarks/many-small-files/small-file-17.txt b/tests/benchmarks/many-small-files/small-file-17.txt new file mode 100644 index 0000000000..a1dafea0af --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-17.txt @@ -0,0 +1 @@ +I am small file 17 diff --git a/tests/benchmarks/many-small-files/small-file-18.txt b/tests/benchmarks/many-small-files/small-file-18.txt new file mode 100644 index 0000000000..2aea21b0b7 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-18.txt @@ -0,0 +1 @@ +I am small file 18 diff --git a/tests/benchmarks/many-small-files/small-file-19.txt b/tests/benchmarks/many-small-files/small-file-19.txt new file mode 100644 index 0000000000..812c5eebf4 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-19.txt @@ -0,0 +1 @@ +I am small file 19 diff --git a/tests/benchmarks/many-small-files/small-file-2.txt b/tests/benchmarks/many-small-files/small-file-2.txt new file mode 100644 index 0000000000..914af6b8b4 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-2.txt @@ -0,0 +1 @@ +I am small file 2 diff --git a/tests/benchmarks/many-small-files/small-file-20.txt b/tests/benchmarks/many-small-files/small-file-20.txt new file mode 100644 index 0000000000..f9822cb83d --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-20.txt @@ -0,0 +1 @@ +I am small file 20 diff --git a/tests/benchmarks/many-small-files/small-file-21.txt b/tests/benchmarks/many-small-files/small-file-21.txt new file mode 100644 index 0000000000..ad61008d6e --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-21.txt @@ -0,0 +1 @@ +I am small file 21 diff --git a/tests/benchmarks/many-small-files/small-file-22.txt b/tests/benchmarks/many-small-files/small-file-22.txt new file mode 100644 index 0000000000..39f0791eff --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-22.txt @@ -0,0 +1 @@ +I am small file 22 diff --git a/tests/benchmarks/many-small-files/small-file-23.txt b/tests/benchmarks/many-small-files/small-file-23.txt new file mode 100644 index 0000000000..6e0868df55 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-23.txt @@ -0,0 +1 @@ +I am small file 23 diff --git a/tests/benchmarks/many-small-files/small-file-24.txt b/tests/benchmarks/many-small-files/small-file-24.txt new file mode 100644 index 0000000000..08e21c069f --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-24.txt @@ -0,0 +1 @@ +I am small file 24 diff --git a/tests/benchmarks/many-small-files/small-file-25.txt b/tests/benchmarks/many-small-files/small-file-25.txt new file mode 100644 index 0000000000..feffff3044 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-25.txt @@ -0,0 +1 @@ +I am small file 25 diff --git a/tests/benchmarks/many-small-files/small-file-26.txt b/tests/benchmarks/many-small-files/small-file-26.txt new file mode 100644 index 0000000000..075a7089c4 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-26.txt @@ -0,0 +1 @@ +I am small file 26 diff --git a/tests/benchmarks/many-small-files/small-file-27.txt b/tests/benchmarks/many-small-files/small-file-27.txt new file mode 100644 index 0000000000..812e0937fc --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-27.txt @@ -0,0 +1 @@ +I am small file 27 diff --git a/tests/benchmarks/many-small-files/small-file-28.txt b/tests/benchmarks/many-small-files/small-file-28.txt new file mode 100644 index 0000000000..188aa0b876 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-28.txt @@ -0,0 +1 @@ +I am small file 28 diff --git a/tests/benchmarks/many-small-files/small-file-29.txt b/tests/benchmarks/many-small-files/small-file-29.txt new file mode 100644 index 0000000000..bb779a6eb0 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-29.txt @@ -0,0 +1 @@ +I am small file 29 diff --git a/tests/benchmarks/many-small-files/small-file-3.txt b/tests/benchmarks/many-small-files/small-file-3.txt new file mode 100644 index 0000000000..d4605ecf6b --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-3.txt @@ -0,0 +1 @@ +I am small file 3 diff --git a/tests/benchmarks/many-small-files/small-file-30.txt b/tests/benchmarks/many-small-files/small-file-30.txt new file mode 100644 index 0000000000..cb748f3c3f --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-30.txt @@ -0,0 +1 @@ +I am small file 30 diff --git a/tests/benchmarks/many-small-files/small-file-31.txt b/tests/benchmarks/many-small-files/small-file-31.txt new file mode 100644 index 0000000000..d6a7a357ec --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-31.txt @@ -0,0 +1 @@ +I am small file 31 diff --git a/tests/benchmarks/many-small-files/small-file-32.txt b/tests/benchmarks/many-small-files/small-file-32.txt new file mode 100644 index 0000000000..e9d13ee038 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-32.txt @@ -0,0 +1 @@ +I am small file 32 diff --git a/tests/benchmarks/many-small-files/small-file-33.txt b/tests/benchmarks/many-small-files/small-file-33.txt new file mode 100644 index 0000000000..1c5284da7d --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-33.txt @@ -0,0 +1 @@ +I am small file 33 diff --git a/tests/benchmarks/many-small-files/small-file-34.txt b/tests/benchmarks/many-small-files/small-file-34.txt new file mode 100644 index 0000000000..6364d4c881 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-34.txt @@ -0,0 +1 @@ +I am small file 34 diff --git a/tests/benchmarks/many-small-files/small-file-35.txt b/tests/benchmarks/many-small-files/small-file-35.txt new file mode 100644 index 0000000000..6a4a6bea7c --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-35.txt @@ -0,0 +1 @@ +I am small file 35 diff --git a/tests/benchmarks/many-small-files/small-file-36.txt b/tests/benchmarks/many-small-files/small-file-36.txt new file mode 100644 index 0000000000..c7f23947a7 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-36.txt @@ -0,0 +1 @@ +I am small file 36 diff --git a/tests/benchmarks/many-small-files/small-file-37.txt b/tests/benchmarks/many-small-files/small-file-37.txt new file mode 100644 index 0000000000..2bdbdad205 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-37.txt @@ -0,0 +1 @@ +I am small file 37 diff --git a/tests/benchmarks/many-small-files/small-file-38.txt b/tests/benchmarks/many-small-files/small-file-38.txt new file mode 100644 index 0000000000..cff8f8c5b5 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-38.txt @@ -0,0 +1 @@ +I am small file 38 diff --git a/tests/benchmarks/many-small-files/small-file-39.txt b/tests/benchmarks/many-small-files/small-file-39.txt new file mode 100644 index 0000000000..1a31a10d07 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-39.txt @@ -0,0 +1 @@ +I am small file 39 diff --git a/tests/benchmarks/many-small-files/small-file-4.txt b/tests/benchmarks/many-small-files/small-file-4.txt new file mode 100644 index 0000000000..f882bfd910 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-4.txt @@ -0,0 +1 @@ +I am small file 4 diff --git a/tests/benchmarks/many-small-files/small-file-40.txt b/tests/benchmarks/many-small-files/small-file-40.txt new file mode 100644 index 0000000000..192abfbd6c --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-40.txt @@ -0,0 +1 @@ +I am small file 40 diff --git a/tests/benchmarks/many-small-files/small-file-41.txt b/tests/benchmarks/many-small-files/small-file-41.txt new file mode 100644 index 0000000000..f2a6fe8e06 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-41.txt @@ -0,0 +1 @@ +I am small file 41 diff --git a/tests/benchmarks/many-small-files/small-file-42.txt b/tests/benchmarks/many-small-files/small-file-42.txt new file mode 100644 index 0000000000..f091e63119 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-42.txt @@ -0,0 +1 @@ +I am small file 42 diff --git a/tests/benchmarks/many-small-files/small-file-43.txt b/tests/benchmarks/many-small-files/small-file-43.txt new file mode 100644 index 0000000000..8f5c4181be --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-43.txt @@ -0,0 +1 @@ +I am small file 43 diff --git a/tests/benchmarks/many-small-files/small-file-44.txt b/tests/benchmarks/many-small-files/small-file-44.txt new file mode 100644 index 0000000000..6b69df5f77 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-44.txt @@ -0,0 +1 @@ +I am small file 44 diff --git a/tests/benchmarks/many-small-files/small-file-45.txt b/tests/benchmarks/many-small-files/small-file-45.txt new file mode 100644 index 0000000000..56ca9062ae --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-45.txt @@ -0,0 +1 @@ +I am small file 45 diff --git a/tests/benchmarks/many-small-files/small-file-46.txt b/tests/benchmarks/many-small-files/small-file-46.txt new file mode 100644 index 0000000000..9ecad26cbd --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-46.txt @@ -0,0 +1 @@ +I am small file 46 diff --git a/tests/benchmarks/many-small-files/small-file-47.txt b/tests/benchmarks/many-small-files/small-file-47.txt new file mode 100644 index 0000000000..a46606cd0c --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-47.txt @@ -0,0 +1 @@ +I am small file 47 diff --git a/tests/benchmarks/many-small-files/small-file-48.txt b/tests/benchmarks/many-small-files/small-file-48.txt new file mode 100644 index 0000000000..9e4b70a0ce --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-48.txt @@ -0,0 +1 @@ +I am small file 48 diff --git a/tests/benchmarks/many-small-files/small-file-49.txt b/tests/benchmarks/many-small-files/small-file-49.txt new file mode 100644 index 0000000000..6da8a669a2 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-49.txt @@ -0,0 +1 @@ +I am small file 49 diff --git a/tests/benchmarks/many-small-files/small-file-5.txt b/tests/benchmarks/many-small-files/small-file-5.txt new file mode 100644 index 0000000000..9f4cbecc94 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-5.txt @@ -0,0 +1 @@ +I am small file 5 diff --git a/tests/benchmarks/many-small-files/small-file-50.txt b/tests/benchmarks/many-small-files/small-file-50.txt new file mode 100644 index 0000000000..24a9be1000 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-50.txt @@ -0,0 +1 @@ +I am small file 50 diff --git a/tests/benchmarks/many-small-files/small-file-51.txt b/tests/benchmarks/many-small-files/small-file-51.txt new file mode 100644 index 0000000000..070eccf7e9 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-51.txt @@ -0,0 +1 @@ +I am small file 51 diff --git a/tests/benchmarks/many-small-files/small-file-52.txt b/tests/benchmarks/many-small-files/small-file-52.txt new file mode 100644 index 0000000000..aebee16c50 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-52.txt @@ -0,0 +1 @@ +I am small file 52 diff --git a/tests/benchmarks/many-small-files/small-file-53.txt b/tests/benchmarks/many-small-files/small-file-53.txt new file mode 100644 index 0000000000..b61a4a478d --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-53.txt @@ -0,0 +1 @@ +I am small file 53 diff --git a/tests/benchmarks/many-small-files/small-file-54.txt b/tests/benchmarks/many-small-files/small-file-54.txt new file mode 100644 index 0000000000..d8e5b908d3 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-54.txt @@ -0,0 +1 @@ +I am small file 54 diff --git a/tests/benchmarks/many-small-files/small-file-55.txt b/tests/benchmarks/many-small-files/small-file-55.txt new file mode 100644 index 0000000000..bc32b3e020 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-55.txt @@ -0,0 +1 @@ +I am small file 55 diff --git a/tests/benchmarks/many-small-files/small-file-56.txt b/tests/benchmarks/many-small-files/small-file-56.txt new file mode 100644 index 0000000000..966f19878d --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-56.txt @@ -0,0 +1 @@ +I am small file 56 diff --git a/tests/benchmarks/many-small-files/small-file-57.txt b/tests/benchmarks/many-small-files/small-file-57.txt new file mode 100644 index 0000000000..6cd916a2cf --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-57.txt @@ -0,0 +1 @@ +I am small file 57 diff --git a/tests/benchmarks/many-small-files/small-file-58.txt b/tests/benchmarks/many-small-files/small-file-58.txt new file mode 100644 index 0000000000..62e7289c10 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-58.txt @@ -0,0 +1 @@ +I am small file 58 diff --git a/tests/benchmarks/many-small-files/small-file-59.txt b/tests/benchmarks/many-small-files/small-file-59.txt new file mode 100644 index 0000000000..cde1672bc2 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-59.txt @@ -0,0 +1 @@ +I am small file 59 diff --git a/tests/benchmarks/many-small-files/small-file-6.txt b/tests/benchmarks/many-small-files/small-file-6.txt new file mode 100644 index 0000000000..0442155537 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-6.txt @@ -0,0 +1 @@ +I am small file 6 diff --git a/tests/benchmarks/many-small-files/small-file-60.txt b/tests/benchmarks/many-small-files/small-file-60.txt new file mode 100644 index 0000000000..7f32cc284b --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-60.txt @@ -0,0 +1 @@ +I am small file 60 diff --git a/tests/benchmarks/many-small-files/small-file-61.txt b/tests/benchmarks/many-small-files/small-file-61.txt new file mode 100644 index 0000000000..1ffcebfa35 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-61.txt @@ -0,0 +1 @@ +I am small file 61 diff --git a/tests/benchmarks/many-small-files/small-file-62.txt b/tests/benchmarks/many-small-files/small-file-62.txt new file mode 100644 index 0000000000..0637cb652f --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-62.txt @@ -0,0 +1 @@ +I am small file 62 diff --git a/tests/benchmarks/many-small-files/small-file-63.txt b/tests/benchmarks/many-small-files/small-file-63.txt new file mode 100644 index 0000000000..ca52a5e921 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-63.txt @@ -0,0 +1 @@ +I am small file 63 diff --git a/tests/benchmarks/many-small-files/small-file-64.txt b/tests/benchmarks/many-small-files/small-file-64.txt new file mode 100644 index 0000000000..0b0184fa68 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-64.txt @@ -0,0 +1 @@ +I am small file 64 diff --git a/tests/benchmarks/many-small-files/small-file-65.txt b/tests/benchmarks/many-small-files/small-file-65.txt new file mode 100644 index 0000000000..6502e2e4e5 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-65.txt @@ -0,0 +1 @@ +I am small file 65 diff --git a/tests/benchmarks/many-small-files/small-file-66.txt b/tests/benchmarks/many-small-files/small-file-66.txt new file mode 100644 index 0000000000..8d1e271941 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-66.txt @@ -0,0 +1 @@ +I am small file 66 diff --git a/tests/benchmarks/many-small-files/small-file-67.txt b/tests/benchmarks/many-small-files/small-file-67.txt new file mode 100644 index 0000000000..fcaf92e316 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-67.txt @@ -0,0 +1 @@ +I am small file 67 diff --git a/tests/benchmarks/many-small-files/small-file-68.txt b/tests/benchmarks/many-small-files/small-file-68.txt new file mode 100644 index 0000000000..11666f15d8 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-68.txt @@ -0,0 +1 @@ +I am small file 68 diff --git a/tests/benchmarks/many-small-files/small-file-69.txt b/tests/benchmarks/many-small-files/small-file-69.txt new file mode 100644 index 0000000000..c342b007e9 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-69.txt @@ -0,0 +1 @@ +I am small file 69 diff --git a/tests/benchmarks/many-small-files/small-file-7.txt b/tests/benchmarks/many-small-files/small-file-7.txt new file mode 100644 index 0000000000..4406b5a457 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-7.txt @@ -0,0 +1 @@ +I am small file 7 diff --git a/tests/benchmarks/many-small-files/small-file-70.txt b/tests/benchmarks/many-small-files/small-file-70.txt new file mode 100644 index 0000000000..2002f08729 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-70.txt @@ -0,0 +1 @@ +I am small file 70 diff --git a/tests/benchmarks/many-small-files/small-file-71.txt b/tests/benchmarks/many-small-files/small-file-71.txt new file mode 100644 index 0000000000..289d86966e --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-71.txt @@ -0,0 +1 @@ +I am small file 71 diff --git a/tests/benchmarks/many-small-files/small-file-72.txt b/tests/benchmarks/many-small-files/small-file-72.txt new file mode 100644 index 0000000000..cf587a9470 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-72.txt @@ -0,0 +1 @@ +I am small file 72 diff --git a/tests/benchmarks/many-small-files/small-file-73.txt b/tests/benchmarks/many-small-files/small-file-73.txt new file mode 100644 index 0000000000..22f409060b --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-73.txt @@ -0,0 +1 @@ +I am small file 73 diff --git a/tests/benchmarks/many-small-files/small-file-74.txt b/tests/benchmarks/many-small-files/small-file-74.txt new file mode 100644 index 0000000000..82da6ab564 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-74.txt @@ -0,0 +1 @@ +I am small file 74 diff --git a/tests/benchmarks/many-small-files/small-file-75.txt b/tests/benchmarks/many-small-files/small-file-75.txt new file mode 100644 index 0000000000..90974dacfc --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-75.txt @@ -0,0 +1 @@ +I am small file 75 diff --git a/tests/benchmarks/many-small-files/small-file-76.txt b/tests/benchmarks/many-small-files/small-file-76.txt new file mode 100644 index 0000000000..401af17e63 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-76.txt @@ -0,0 +1 @@ +I am small file 76 diff --git a/tests/benchmarks/many-small-files/small-file-77.txt b/tests/benchmarks/many-small-files/small-file-77.txt new file mode 100644 index 0000000000..2c8c8fbe0a --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-77.txt @@ -0,0 +1 @@ +I am small file 77 diff --git a/tests/benchmarks/many-small-files/small-file-78.txt b/tests/benchmarks/many-small-files/small-file-78.txt new file mode 100644 index 0000000000..5ade3992d0 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-78.txt @@ -0,0 +1 @@ +I am small file 78 diff --git a/tests/benchmarks/many-small-files/small-file-79.txt b/tests/benchmarks/many-small-files/small-file-79.txt new file mode 100644 index 0000000000..1b72241dde --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-79.txt @@ -0,0 +1 @@ +I am small file 79 diff --git a/tests/benchmarks/many-small-files/small-file-8.txt b/tests/benchmarks/many-small-files/small-file-8.txt new file mode 100644 index 0000000000..dd788d7976 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-8.txt @@ -0,0 +1 @@ +I am small file 8 diff --git a/tests/benchmarks/many-small-files/small-file-80.txt b/tests/benchmarks/many-small-files/small-file-80.txt new file mode 100644 index 0000000000..a3e48ad4c2 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-80.txt @@ -0,0 +1 @@ +I am small file 80 diff --git a/tests/benchmarks/many-small-files/small-file-81.txt b/tests/benchmarks/many-small-files/small-file-81.txt new file mode 100644 index 0000000000..00d5991c60 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-81.txt @@ -0,0 +1 @@ +I am small file 81 diff --git a/tests/benchmarks/many-small-files/small-file-82.txt b/tests/benchmarks/many-small-files/small-file-82.txt new file mode 100644 index 0000000000..4a3a122d0d --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-82.txt @@ -0,0 +1 @@ +I am small file 82 diff --git a/tests/benchmarks/many-small-files/small-file-83.txt b/tests/benchmarks/many-small-files/small-file-83.txt new file mode 100644 index 0000000000..31e322b9ca --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-83.txt @@ -0,0 +1 @@ +I am small file 83 diff --git a/tests/benchmarks/many-small-files/small-file-84.txt b/tests/benchmarks/many-small-files/small-file-84.txt new file mode 100644 index 0000000000..f1cffa1212 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-84.txt @@ -0,0 +1 @@ +I am small file 84 diff --git a/tests/benchmarks/many-small-files/small-file-85.txt b/tests/benchmarks/many-small-files/small-file-85.txt new file mode 100644 index 0000000000..80d6d1d39a --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-85.txt @@ -0,0 +1 @@ +I am small file 85 diff --git a/tests/benchmarks/many-small-files/small-file-86.txt b/tests/benchmarks/many-small-files/small-file-86.txt new file mode 100644 index 0000000000..82fcebdfdf --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-86.txt @@ -0,0 +1 @@ +I am small file 86 diff --git a/tests/benchmarks/many-small-files/small-file-87.txt b/tests/benchmarks/many-small-files/small-file-87.txt new file mode 100644 index 0000000000..c476c7dc5e --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-87.txt @@ -0,0 +1 @@ +I am small file 87 diff --git a/tests/benchmarks/many-small-files/small-file-88.txt b/tests/benchmarks/many-small-files/small-file-88.txt new file mode 100644 index 0000000000..0a984d3109 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-88.txt @@ -0,0 +1 @@ +I am small file 88 diff --git a/tests/benchmarks/many-small-files/small-file-89.txt b/tests/benchmarks/many-small-files/small-file-89.txt new file mode 100644 index 0000000000..8bbd9b7ef3 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-89.txt @@ -0,0 +1 @@ +I am small file 89 diff --git a/tests/benchmarks/many-small-files/small-file-9.txt b/tests/benchmarks/many-small-files/small-file-9.txt new file mode 100644 index 0000000000..10832c17eb --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-9.txt @@ -0,0 +1 @@ +I am small file 9 diff --git a/tests/benchmarks/many-small-files/small-file-90.txt b/tests/benchmarks/many-small-files/small-file-90.txt new file mode 100644 index 0000000000..72c35dfb79 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-90.txt @@ -0,0 +1 @@ +I am small file 90 diff --git a/tests/benchmarks/many-small-files/small-file-91.txt b/tests/benchmarks/many-small-files/small-file-91.txt new file mode 100644 index 0000000000..e9ad0fa8da --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-91.txt @@ -0,0 +1 @@ +I am small file 91 diff --git a/tests/benchmarks/many-small-files/small-file-92.txt b/tests/benchmarks/many-small-files/small-file-92.txt new file mode 100644 index 0000000000..ac1be6107b --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-92.txt @@ -0,0 +1 @@ +I am small file 92 diff --git a/tests/benchmarks/many-small-files/small-file-93.txt b/tests/benchmarks/many-small-files/small-file-93.txt new file mode 100644 index 0000000000..019e2ef89d --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-93.txt @@ -0,0 +1 @@ +I am small file 93 diff --git a/tests/benchmarks/many-small-files/small-file-94.txt b/tests/benchmarks/many-small-files/small-file-94.txt new file mode 100644 index 0000000000..bfc1150d29 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-94.txt @@ -0,0 +1 @@ +I am small file 94 diff --git a/tests/benchmarks/many-small-files/small-file-95.txt b/tests/benchmarks/many-small-files/small-file-95.txt new file mode 100644 index 0000000000..2dbb3e72b1 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-95.txt @@ -0,0 +1 @@ +I am small file 95 diff --git a/tests/benchmarks/many-small-files/small-file-96.txt b/tests/benchmarks/many-small-files/small-file-96.txt new file mode 100644 index 0000000000..5c244ad8cd --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-96.txt @@ -0,0 +1 @@ +I am small file 96 diff --git a/tests/benchmarks/many-small-files/small-file-97.txt b/tests/benchmarks/many-small-files/small-file-97.txt new file mode 100644 index 0000000000..44e4b98b90 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-97.txt @@ -0,0 +1 @@ +I am small file 97 diff --git a/tests/benchmarks/many-small-files/small-file-98.txt b/tests/benchmarks/many-small-files/small-file-98.txt new file mode 100644 index 0000000000..2647911e47 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-98.txt @@ -0,0 +1 @@ +I am small file 98 diff --git a/tests/benchmarks/many-small-files/small-file-99.txt b/tests/benchmarks/many-small-files/small-file-99.txt new file mode 100644 index 0000000000..81a4ad9493 --- /dev/null +++ b/tests/benchmarks/many-small-files/small-file-99.txt @@ -0,0 +1 @@ +I am small file 99 diff --git a/tests/benchmarks/run-benchmarks.sh b/tests/benchmarks/run-benchmarks.sh index 7542abbfc8..26455665df 100755 --- a/tests/benchmarks/run-benchmarks.sh +++ b/tests/benchmarks/run-benchmarks.sh @@ -136,3 +136,13 @@ for wrap in character never; do cat "$RESULT_DIR/syntax-highlighting-speed-${filename}.md" >> "$REPORT" done done + + +heading "Many small files speed (overhead of metadata)" +hyperfine \ + "$(printf "%q" "$BAT") --no-config --language=txt --style=plain many-small-files/*.txt" \ + --command-name 'bat … --language=txt *.txt' \ + --warmup "$WARMUP_COUNT" \ + --export-markdown "$RESULT_DIR/many-small-files-speed.md" \ + --export-json "$RESULT_DIR/many-small-files-speed.json" +cat "$RESULT_DIR/many-small-files-speed.md" >> "$REPORT" diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 5648f252cd..a4224c9463 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -919,7 +919,7 @@ fn empty_file_leads_to_empty_output_with_rule_enabled() { } #[test] -fn filename_basic() { +fn header_basic() { bat() .arg("test.txt") .arg("--decorations=always") @@ -933,7 +933,21 @@ fn filename_basic() { } #[test] -fn filename_binary() { +fn header_full_basic() { + bat() + .arg("test.txt") + .arg("--decorations=always") + .arg("--style=header-filename,header-filesize") + .arg("-r=0:0") + .arg("--file-name=foo") + .assert() + .success() + .stdout("File: foo\nSize: 12 B\n") + .stderr(""); +} + +#[test] +fn header_binary() { bat() .arg("test.binary") .arg("--decorations=always") @@ -946,6 +960,20 @@ fn filename_binary() { .stderr(""); } +#[test] +fn header_full_binary() { + bat() + .arg("test.binary") + .arg("--decorations=always") + .arg("--style=header-filename,header-filesize") + .arg("-r=0:0") + .arg("--file-name=foo") + .assert() + .success() + .stdout("File: foo \nSize: 4 B\n") + .stderr(""); +} + #[test] fn filename_stdin() { bat() @@ -1016,6 +1044,18 @@ fn header_padding() { .stderr(""); } +#[test] +fn header_full_padding() { + bat() + .arg("--decorations=always") + .arg("--style=header-filename,header-filesize") + .arg("test.txt") + .arg("single-line.txt") + .assert() + .stdout("File: test.txt\nSize: 12 B\nhello world\n\nFile: single-line.txt\nSize: 11 B\nSingle Line\n") + .stderr(""); +} + #[test] fn header_padding_rule() { bat() @@ -1036,6 +1076,28 @@ Single Line .stderr(""); } +#[test] +fn header_full_padding_rule() { + bat() + .arg("--decorations=always") + .arg("--style=header-filename,header-filesize,rule") + .arg("--terminal-width=80") + .arg("test.txt") + .arg("single-line.txt") + .assert() + .stdout( + "File: test.txt +Size: 12 B +hello world +──────────────────────────────────────────────────────────────────────────────── +File: single-line.txt +Size: 11 B +Single Line +", + ) + .stderr(""); +} + #[test] fn grid_overrides_rule() { bat() @@ -1219,6 +1281,7 @@ fn grid_for_file_without_newline() { "\ ───────┬──────────────────────────────────────────────────────────────────────── │ File: single-line.txt + │ Size: 11 B ───────┼──────────────────────────────────────────────────────────────────────── 1 │ Single Line ───────┴──────────────────────────────────────────────────────────────────────── diff --git a/tests/snapshots/output/full.snapshot.txt b/tests/snapshots/output/full.snapshot.txt index f8ecaa32c3..924b65dafb 100644 --- a/tests/snapshots/output/full.snapshot.txt +++ b/tests/snapshots/output/full.snapshot.txt @@ -1,5 +1,6 @@ ───────┬──────────────────────────────────────────────────────────────────────── │ File: sample.rs + │ Size: 533 B ───────┼──────────────────────────────────────────────────────────────────────── 1 + │ /// A rectangle. First line is changed to prevent a regression of #1869 2 │ struct Rectangle {