diff test/call_suite_aggrs/mk-cases.lua @ 514:01f928eb9584

- more test code generator code sharing
author Tassilo Philipp
date Sun, 10 Apr 2022 16:18:28 +0200
parents 4d0541bf9b38
children 99819b874bac
line wrap: on
line diff
--- a/test/call_suite_aggrs/mk-cases.lua	Sun Apr 10 16:10:10 2022 +0200
+++ b/test/call_suite_aggrs/mk-cases.lua	Sun Apr 10 16:18:28 2022 +0200
@@ -1,5 +1,11 @@
 require"config"
 require"math"
+
+-- use shared helpers to generate cases
+package.path = '../common/?.lua;' .. package.path
+require"mk-cases"
+
+
 local max_numargs = 0
 
 local aggrs = { }
@@ -20,7 +26,6 @@
 end
 
 
-function trim(l) return l:gsub("^%s+",""):gsub("%s+$","") end
 function mkcase(id,sig)
   local sig = trim(sig)
   local fsig = put_sig_rtype_first(sig)
@@ -110,11 +115,6 @@
   return table.concat(h,"")..table.concat(t,"")
 end
 
--- use shared helpers to generate cases
-package.path = '../common/?.lua;' .. package.path
-require"mk-cases"
-
-
 function split_array_decl(s)
   local name = s
   local n = nil  -- not an array