test: limit size of linexps in intsolver tests

This commit is contained in:
Simon Cruanes 2022-01-19 11:42:42 -05:00
parent 7ea4c4fb4a
commit a6c056969c
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -38,7 +38,8 @@ let unwrap_opt_ msg = function
let rand_n low n : Z.t QC.arbitrary = let rand_n low n : Z.t QC.arbitrary =
QC.map ~rev:ZarithZ.to_int Z.of_int QC.(low -- n) QC.map ~rev:ZarithZ.to_int Z.of_int QC.(low -- n)
let rand_z = rand_n (-1000) 30_000 (* TODO: fudge *)
let rand_z = rand_n (-50) 100
module Step = struct module Step = struct
module G = QC.Gen module G = QC.Gen
@ -98,7 +99,7 @@ module Step = struct
else ( else (
let gen_linexp = let gen_linexp =
let* vars' = G.shuffle_l vars in let* vars' = G.shuffle_l vars in
let* n = 1 -- List.length vars' in let* n = 1 -- (min 7 @@ List.length vars') in
let vars' = CCList.take n vars' in let vars' = CCList.take n vars' in
assert (List.length vars' = n); assert (List.length vars' = n);
let* coeffs = list_repeat n rand_z.gen in let* coeffs = list_repeat n rand_z.gen in