fn prop_count_len(name: &str, rows: CsvData,
                  headers: bool, idx: bool) -> bool {
    let mut expected_count = rows.len();
    if headers && expected_count > 0 {
        expected_count -= 1;
    }

    let wrk = Workdir::new(name);
    if idx {
        wrk.create_indexed("in.csv", rows);
    } else {
        wrk.create("in.csv", rows);
    }

    let mut cmd = wrk.command("count");
    if !headers {
        cmd.arg("--no-headers");
    }
    cmd.arg("in.csv");

    let got_count: usize = wrk.stdout(&mut cmd);
    rassert_eq!(got_count, expected_count)
}
This tests whether `xsv count` gets the right answer.

It does some simple case analysis to handle whether we want to test counts
in the presence of headers and/or indexes.
tests/test_count.rs