mirror of
https://github.com/rzmk/czv.git
synced 2025-12-19 08:09:24 +00:00
refactor: use options object for WASM function args, improve docs
- Add relevant links to all READMEs and source code - Resolve clippy lints czv: - Add more docs for top-level items - Add suggestion to use builder methods instead of functions - Disable slice and slice tests until operation is complete czv-wasm: - Use tsify_next for allowing objects as parameters - Add nodejs example and instructions
This commit is contained in:
parent
ce260e9491
commit
e84c5bec8b
20 changed files with 564 additions and 168 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use czv_wasm;
|
||||
use czv_wasm::count::RowCountOptions;
|
||||
use czv_wasm::Result;
|
||||
use wasm_bindgen_test::*;
|
||||
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
|
@ -6,14 +7,15 @@ wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
|
|||
#[test]
|
||||
#[wasm_bindgen_test]
|
||||
fn basic() -> Result<()> {
|
||||
let result = czv_wasm::count::row_count(
|
||||
"fruit,price
|
||||
let options = RowCountOptions {
|
||||
file_data: "fruit,price
|
||||
apple,2.00
|
||||
banana,1.50
|
||||
strawberry,3.00"
|
||||
.to_string(),
|
||||
Some(false),
|
||||
)?;
|
||||
include_header_row: Some(false),
|
||||
};
|
||||
let result = czv_wasm::count::row_count(options)?;
|
||||
assert_eq!(result, 3);
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue