Mercurial > pub > dyncall > dyncall
view test/call_suite/rand-sig.lua @ 448:987a2af078c8
test/Makefile.generic fix (copy/paste error)
author | Tassilo Philipp |
---|---|
date | Thu, 27 Jan 2022 11:39:35 +0100 |
parents | 135c7fb49c2f |
children | d45c582b5457 |
line wrap: on
line source
require"config" rtypes = "v"..types math.randomseed(seed) local id local uniq_sigs = { } for i = 1, ncases do local l = '' repeat local nargs = math.random(minargs,maxargs) id = math.random(#rtypes) local sig = { rtypes:sub(id,id)} for j = 1, nargs do id = math.random(#types) sig[#sig+1] = types:sub(id,id) end l = table.concat(sig) -- reject dupes until uniq_sigs[l] == nil uniq_sigs[l] = 1 io.write(l.."\n") end