mirror of
https://github.com/rzmk/czv.git
synced 2025-12-19 08:09:24 +00:00
test: add row count with header
This commit is contained in:
parent
719f3e1512
commit
358fe0a8b9
1 changed files with 17 additions and 1 deletions
|
|
@ -6,7 +6,7 @@ wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[wasm_bindgen_test]
|
#[wasm_bindgen_test]
|
||||||
fn basic() -> Result<()> {
|
fn row_count_nonheader() -> Result<()> {
|
||||||
let options = RowCountOptions {
|
let options = RowCountOptions {
|
||||||
file_data: "fruit,price
|
file_data: "fruit,price
|
||||||
apple,2.00
|
apple,2.00
|
||||||
|
|
@ -19,3 +19,19 @@ strawberry,3.00"
|
||||||
assert_eq!(result, 3);
|
assert_eq!(result, 3);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[wasm_bindgen_test]
|
||||||
|
fn row_count_header() -> Result<()> {
|
||||||
|
let options = RowCountOptions {
|
||||||
|
file_data: "fruit,price
|
||||||
|
apple,2.00
|
||||||
|
banana,1.50
|
||||||
|
strawberry,3.00"
|
||||||
|
.to_string(),
|
||||||
|
include_header_row: Some(true),
|
||||||
|
};
|
||||||
|
let result = czv_wasm::count::row_count(options)?;
|
||||||
|
assert_eq!(result, 4);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue