Skip to content

Commit

Permalink
Fix JS job.
Browse files Browse the repository at this point in the history
  • Loading branch information
rturrado committed Mar 28, 2024
1 parent 519cb55 commit 765788e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion emscripten/test_cqasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ wrapper().then(function(result) {
try {
var program_2 = "version 3;qubit[5] q;h q[0:4];measure q"
output = cqasm.parse_string_to_json(program_2, "<unknown>")
expected_output = String.raw`{"Program":{"version":{"Version":{"items":"3","source_location":"<unknown>:1:9..10"}},"block":{"GlobalBlock":{"qubit_variable_declaration":{"Variable":{"name":{"Identifier":{"name":"q"}},"typ":{"Type":{"name":{"Keyword":{"name":"qubit"}},"size":{"IntegerLiteral":{"value":"5"}},"source_location":"<unknown>:1:11..19"}},"annotations":"[]","source_location":"<unknown>:1:20..21"}},"gates":[{"Gate":{"name":{"Identifier":{"name":"h"}},"operands":{"ExpressionList":{"items":[{"Index":{"expr":{"Identifier":{"name":"q"}},"indices":{"IndexList":{"items":[{"IndexRange":{"first":{"IntegerLiteral":{"value":"0","source_location":"<unknown>:1:26..27"}},"last":{"IntegerLiteral":{"value":"4","source_location":"<unknown>:1:28..29"}}}}]}},"source_location":"<unknown>:1:24..25"}}]}},"annotations":"[]","source_location":"<unknown>:1:22..23"}}],"measure_instruction":{"MeasureInstruction":{"name":{"Identifier":{"name":"measure"}},"operands":{"ExpressionList":{"items":[{"Identifier":{"name":"q","source_location":"<unknown>:1:39..40"}}]}},"annotations":"[]","source_location":"<unknown>:1:31..38"}}}}}}`
expected_output = String.raw`{"Program":{"version":{"Version":{"items":"3","source_location":"<unknown>:1:9..10"}},"block":{"GlobalBlock":{"qubit_variable_declaration":{"Variable":{"name":{"Identifier":{"name":"q"}},"typ":{"Type":{"name":{"Keyword":{"name":"qubit"}},"size":{"IntegerLiteral":{"value":"5"}},"source_location":"<unknown>:1:11..19"}},"annotations":"[]","source_location":"<unknown>:1:20..21"}},"gates":[{"Gate":{"name":{"Identifier":{"name":"h"}},"operands":{"ExpressionList":{"items":[{"Index":{"expr":{"Identifier":{"name":"q"}},"indices":{"IndexList":{"items":[{"IndexRange":{"first":{"IntegerLiteral":{"value":"0","source_location":"<unknown>:1:26..27"}},"last":{"IntegerLiteral":{"value":"4","source_location":"<unknown>:1:28..29"}}}}]}},"source_location":"<unknown>:1:24..25"}}]}},"annotations":"[]","source_location":"<unknown>:1:22..23"}}],"measure_instruction":{"MeasureInstruction":{"name":{"Identifier":{"name":"measure"}},"operand":{"Identifier":{"name":"q","source_location":"<unknown>:1:39..40"}},"annotations":"[]","source_location":"<unknown>:1:31..38"}}}}}}`
console.log("\nExample 2:", program_2, "\n\tCalling parse_string_to_json...", "\n\tOutput:", output)
if (output !== expected_output) {
console.log("\tExpected output:", expected_output)
Expand Down

0 comments on commit 765788e

Please sign in to comment.