From 0fd00aaf6aa25cf043629ed46f92aacd3a716d92 Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 22 Aug 2022 14:18:56 +0200 Subject: [PATCH] fix function naming, minor tests refactor --- zokrates_js/build.rs | 4 ++-- zokrates_js/tests/tests.js | 36 ++++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/zokrates_js/build.rs b/zokrates_js/build.rs index 7499d410..e8c6540f 100644 --- a/zokrates_js/build.rs +++ b/zokrates_js/build.rs @@ -3,11 +3,11 @@ use std::{env, fs}; use walkdir::WalkDir; fn main() { - export_stdlib_js(); + export_stdlib(); export_metadata(); } -fn export_stdlib_js() { +fn export_stdlib() { let root = "../zokrates_stdlib/stdlib"; let mut stdlib = json::JsonValue::new_object(); diff --git a/zokrates_js/tests/tests.js b/zokrates_js/tests/tests.js index 092aaf64..38ae18b8 100644 --- a/zokrates_js/tests/tests.js +++ b/zokrates_js/tests/tests.js @@ -245,24 +245,28 @@ describe("tests", () => { }); }; - describe("ark", () => { - for (const scheme of ["g16", "gm17", "marlin"]) { - describe(scheme, () => { - for (const curve of ["bn128", "bls12_381", "bls12_377", "bw6_761"]) { - describe(curve, () => - runWithOptions({ backend: "ark", scheme, curve }) - ); - } - }); - } - }); + let combinations = { + ark: { + schemes: ["g16", "gm17", "marlin"], + curves: ["bn128", "bls12_381", "bls12_377", "bw6_761"], + }, + bellman: { + schemes: ["g16"], + curves: ["bn128"], + }, + }; - describe("bellman", () => { - describe("g16", () => { - describe("bn128", () => - runWithOptions({ backend: "bellman", scheme: "g16", curve: "bn128" })); + for (const backend of Object.keys(combinations)) { + describe(backend, () => { + for (const scheme of combinations[backend].schemes) { + describe(scheme, () => { + for (const curve of combinations[backend].curves) { + describe(curve, () => runWithOptions({ backend, scheme, curve })); + } + }); + } }); - }); + } const testRunner = (rootPath, testPath, test) => { let entryPoint;