Commit Diff


commit - 3694e2010bce025b19d7f5103f885ff5c19f1d91
commit + 0be3d626d12e4cf587d3cf70c5ea99407b806a37
blob - /dev/null
blob + 888c8428dba04a484e40e95d0f10999e440f32e2 (mode 644)
--- /dev/null
+++ tests/tarantool_csv.lua
@@ -0,0 +1,31 @@
+-- https://www.tarantool.io/en/doc/latest/reference/reference_lua/csv/
+
+local csv = require("csv")
+local luzer = require("luzer")
+
+local function TestOneInput(buf)
+    local ok, res = pcall(csv.load, buf)
+    if ok == true then
+        assert(res ~= nil)
+    end
+	ok, res = pcall(csv.dump, res)
+	assert(ok == true)
+	assert(res)
+end
+
+if arg[1] then
+    local testcase = io.open(arg[1]):read("*all")
+    TestOneInput(testcase)
+    os.exit()
+end
+
+local script_path = debug.getinfo(1).source:match("@?(.*/)")
+
+local args = {
+    dict = script_path .. "tarantool-corpus/csv.dict",
+    corpus = script_path .. "tarantool-corpus/csv_load",
+    artifact_prefix = "csv_load_",
+    max_total_time = 60,
+    print_final_stats = 1,
+}
+luzer.Fuzz(TestOneInput, nil, args)