mirror of
https://github.com/rzmk/czv.git
synced 2025-12-19 08:09:24 +00:00
test(wasm): add column_count
This commit is contained in:
parent
358fe0a8b9
commit
1e7c4a1569
1 changed files with 16 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use czv_wasm;
|
||||
use czv_wasm::count::RowCountOptions;
|
||||
use czv_wasm::count::{ColumnCountOptions, RowCountOptions};
|
||||
use czv_wasm::Result;
|
||||
use wasm_bindgen_test::*;
|
||||
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
|
@ -35,3 +35,18 @@ strawberry,3.00"
|
|||
assert_eq!(result, 4);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[wasm_bindgen_test]
|
||||
fn column_count() -> Result<()> {
|
||||
let options = ColumnCountOptions {
|
||||
file_data: "fruit,price
|
||||
apple,2.00
|
||||
banana,1.50
|
||||
strawberry,3.00"
|
||||
.to_string(),
|
||||
};
|
||||
let result = czv_wasm::count::column_count(options)?;
|
||||
assert_eq!(result, 2);
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue