@@ -42,6 +42,7 @@ def test_table_command_with_stats(tmp_path, monkeypatch) -> None:
4242 assert "Previous Current Diff % Diff" in result .output
4343 assert " 2 2 0 0.0%" in result .output
4444 assert "COL" in result .output
45+ assert "TYPE" in result .output
4546 assert "MATCH" in result .output
4647 assert "0 (no change)" in result .output
4748 assert "Schemas match on column names (3 common columns)." in result .output
@@ -71,8 +72,10 @@ def test_table_command_with_stats_from_files() -> None:
7172 assert "Column comparison:" in result .output
7273 assert "NULL" in result .output
7374 assert "DUP" in result .output
75+ assert "TYPE" in result .output
7476 assert "MATCH" in result .output
7577 assert "notes" in result .output
78+ assert "VARCHAR (no change)" in result .output
7679 assert "2 -> 1 (-50%)" in result .output
7780 assert "0 (no change)" in result .output
7881
@@ -223,6 +226,25 @@ def test_stats_command_reports_schema_differences(tmp_path) -> None:
223226 assert "Column comparison:" in result .output
224227
225228
229+ def test_stats_command_reports_type_changes_in_column_comparison (tmp_path ) -> None :
230+ previous = tmp_path / "previous.csv"
231+ current = tmp_path / "current.csv"
232+ previous .write_text ("id,code\n 1,100\n 2,200\n " , encoding = "utf-8" )
233+ current .write_text ("id,code\n 1,A100\n 2,B200\n " , encoding = "utf-8" )
234+ runner = CliRunner ()
235+
236+ result = runner .invoke (app , ["run" , "stats" , str (previous ), str (current )])
237+
238+ assert result .exit_code == 0 , result .output
239+ assert "Schema differences:" in result .output
240+ assert "Type changes:" in result .output
241+ assert "code: BIGINT -> VARCHAR" in result .output
242+ assert "Column comparison:" in result .output
243+ assert "TYPE" in result .output
244+ assert "BIGINT -> VARCHAR" in result .output
245+ assert "BIGINT (no change)" in result .output
246+
247+
226248def test_stats_command_skips_column_checks_when_no_common_columns (tmp_path ) -> None :
227249 previous = tmp_path / "previous.csv"
228250 current = tmp_path / "current.csv"
0 commit comments