Fix undefined if

This commit is contained in:
Jordi Baylina
2018-10-29 07:09:28 +01:00
parent 9d0b27a7e8
commit bfdf17fd89
3 changed files with 52 additions and 18 deletions

14
test/cases.js Normal file
View File

@@ -0,0 +1,14 @@
const chai = require("chai");
const path = require("path");
const snarkjs = require("snarkjs");
const crypto = require("crypto");
const compiler = require("../index.js");
const assert = chai.assert;
describe("Sum test", () => {
it("Should compile a code with an undefined if", async() => {
await compiler(path.join(__dirname, "circuits", "undefinedif.circom"));
});
});

View File

@@ -0,0 +1,14 @@
template X() {
signal input i;
signal input j;
signal output out;
if (i == 0) {
out <-- i;
}
else {
out <-- j;
}
}
component main = X();