commit 3694e2010bce025b19d7f5103f885ff5c19f1d91 from: Sergey Bronnikov via: Sergey Bronnikov date: Wed Apr 05 06:51:47 2023 UTC tests: add decimal test commit - 2b2050d05a7da14260e11d1d279486a40670cd51 commit + 3694e2010bce025b19d7f5103f885ff5c19f1d91 blob - /dev/null blob + 721c9bca137ff1f8dc728e5f2f352a39237939e7 (mode 644) --- /dev/null +++ tests/tarantool_decimal.lua @@ -0,0 +1,33 @@ +-- https://www.tarantool.io/en/doc/latest/reference/reference_lua/decimal/ + +local luzer = require("luzer") +local decimal = require("decimal") + +local function TestOneInput(buf) + local ok, res = pcall(decimal.new, buf) + if ok == false then + return + end + assert(res ~= nil) + assert(decimal.is_decimal(res) == true) + assert(res - res == 0) +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 = { + max_len = 4096, + corpus = script_path .. "tarantool-corpus/decimal_new", + print_pcs = 1, + detect_leaks = 1, + artifact_prefix = "decimal_new_", + max_total_time = 60, + print_final_stats = 1, +} +luzer.Fuzz(TestOneInput, nil, args)