Skip to content

Commit

Permalink
test: add example
Browse files Browse the repository at this point in the history
  • Loading branch information
lonerapier committed Oct 8, 2024
1 parent 9dbc27a commit cbf5595
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion circuits/test/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export function readJSONInputFile(filename: string, key: any[]): [number[], numb
input = byteArray;

let jsonFile = JSON.parse(data);
let value: string = key.reduce((acc, key) => acc && acc[key], jsonFile).toString();
let value = key.reduce((acc, key) => acc && acc[key], jsonFile);
value = value.toString();
for (let i = 0; i < value.length; i++) {
output.push(value.charCodeAt(i));
}
Expand Down
5 changes: 2 additions & 3 deletions examples/json/test/array_only.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
[
0,
42,
{
"a": "b"
},
1,
[
0,
1
],
"b"
"foobar"
]
2 changes: 1 addition & 1 deletion examples/json/test/value_object.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "a": { "d" : "e", "e": "c" }, "e": { "f": "a", "e": "2" }, "g": { "h": { "a": "c" }} }
{ "a": { "d" : "e", "e": "c" }, "e": { "f": "a", "e": "2" }, "g": { "h": { "a": "c" }}, "ab": "foobar", "bc": 42 }

0 comments on commit cbf5595

Please sign in to comment.