From d59ffa9daa85a46a36a0b68f59c5c43d36ae7a46 Mon Sep 17 00:00:00 2001 From: rzmk <30333942+rzmk@users.noreply.github.com> Date: Sat, 22 Jun 2024 08:38:00 -0400 Subject: [PATCH] W-test: add `column_count` --- czv-wasm/tests/count.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/czv-wasm/tests/count.rs b/czv-wasm/tests/count.rs index 4c858c2..7b04e7a 100644 --- a/czv-wasm/tests/count.rs +++ b/czv-wasm/tests/count.rs @@ -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(()) +}