Skip to content

Commit

Permalink
W-test: add column_count
Browse files Browse the repository at this point in the history
  • Loading branch information
rzmk committed Jun 22, 2024
1 parent 358fe0a commit d59ffa9
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion czv-wasm/tests/count.rs
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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(())
}

0 comments on commit d59ffa9

Please sign in to comment.