test_tsv.lua

dofile "test_data.lua"

local tsv = require "tsv"

local row = 0;
for line in io.lines("test_data.tsv") do
	row = row + 1;
	local col = 0;
	tsv.read_record(line, function (v) 
		col = col + 1;
		if data[row][col] ~= v then
			print(("MISMATCH at row %d, column %d: %s is not %s")
				:format(row, col, v, tostring(data[row][col])))
			bad = true;
		end
	end);
end

os.exit(bad and 1 or 0);