chore(release): prepare public source release
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
[package]
|
||||
name = "csvshape"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
readme.workspace = true
|
||||
publish.workspace = true
|
||||
description = "Summarize large CSV and TSV files with bounded, AI-friendly output."
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
common = { path = "../common", default-features = false }
|
||||
csv.workspace = true
|
||||
lexopt.workspace = true
|
||||
serde.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
assert_cmd.workspace = true
|
||||
predicates.workspace = true
|
||||
tempfile.workspace = true
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
//! Binary entry point for `csvshape`.
|
||||
|
||||
fn main() {
|
||||
std::process::exit(csvshape::main_entry());
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
//! Integration tests for the `csvshape` command.
|
||||
|
||||
use std::fs;
|
||||
|
||||
use assert_cmd::Command;
|
||||
use predicates::prelude::*;
|
||||
use tempfile::tempdir;
|
||||
|
||||
fn cargo_command() -> Command {
|
||||
Command::cargo_bin("csvshape").expect("binary")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn summarizes_csv_as_json() {
|
||||
let temp = tempdir().expect("tempdir");
|
||||
let path = temp.path().join("sample.csv");
|
||||
fs::write(
|
||||
&path,
|
||||
"name,age,city\nAda,34,London\nBob,,Paris\nCara,29,Paris\n",
|
||||
)
|
||||
.expect("fixture");
|
||||
|
||||
cargo_command()
|
||||
.arg("--json")
|
||||
.arg(&path)
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("\"row_count\":3"))
|
||||
.stdout(predicate::str::contains("\"column_count\":3"))
|
||||
.stdout(predicate::str::contains("\"name\":\"age\""));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn help_includes_csv_examples() {
|
||||
cargo_command()
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains(
|
||||
"csvshape [OPTIONS] diff <BEFORE> <AFTER>",
|
||||
))
|
||||
.stdout(predicate::str::contains("--sample-rows"))
|
||||
.stdout(predicate::str::contains("ConvertFrom-Json"))
|
||||
.stdout(predicate::str::contains("csvshape"));
|
||||
}
|
||||
Reference in New Issue
Block a user