feat: add czv, czv-wasm, and czv-python (init release)

This commit is contained in:
rzmk 2024-06-19 22:37:33 -04:00
commit 9799ab694b
No known key found for this signature in database
40 changed files with 70383 additions and 0 deletions

View file

@ -0,0 +1,24 @@
import czv
import pytest
from .test_data import test_data
class TestCountFunc:
@pytest.mark.parametrize(
"file_name,expected",
[("fruits.csv", 3), ("constituents_altnames.csv", 33971)],
)
def test_count(self, file_name, expected):
"""Count the total number of non-header rows."""
result = czv.row_count(test_data[file_name].read_text())
assert result == expected
@pytest.mark.parametrize(
"file_name,expected",
[("fruits.csv", 4), ("constituents_altnames.csv", 33972)],
)
def test_include_header_row(self, file_name, expected):
"""Count the total number of rows including the header row."""
result = czv.row_count(test_data[file_name].read_text(), include_header_row=True)
assert result == expected