From 3d46092dbfa568459c8b4f40fe57a0fed3e5f071 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Fri, 23 Jun 2023 00:07:28 -0700 Subject: [PATCH] [tests] Some negative instruction parsing tests. --- .../parser/instruction/instruction_fail.out | 54 +++++++++++++++++++ .../parser/instruction/instruction_fail.aleo | 6 +++ 2 files changed, 60 insertions(+) diff --git a/synthesizer/tests/expectations/parser/instruction/instruction_fail.out b/synthesizer/tests/expectations/parser/instruction/instruction_fail.out index 946d13d7b7..8cb75efd01 100644 --- a/synthesizer/tests/expectations/parser/instruction/instruction_fail.out +++ b/synthesizer/tests/expectations/parser/instruction/instruction_fail.out @@ -16,3 +16,57 @@ add s0 r1 into r3; ^ +- |+ + 0: at line 1, in Tag: + hash.bhp2048 r0 into r1 as field; + ^ + + 1: at line 1, in Alt: + hash.bhp2048 r0 into r1 as field; + ^ + +- |+ + 0: at line 1, in Tag: + hash.pds2 r0 into r1 as field; + ^ + + 1: at line 1, in Alt: + hash.pds2 r0 into r1 as field; + ^ + +- |+ + 0: at line 1, in Tag: + commit.ped128 r0 r1 into r2; + ^ + + 1: at line 1, in Alt: + commit.ped128 r0 r1 into r2; + ^ + +- |+ + 0: at line 1, in Tag: + add_w r0 r1 into r2; + ^ + + 1: at line 1, in Alt: + add_w r0 r1 into r2; + ^ + +- |+ + 0: at line 1, in Tag: + assert r0; + ^ + + 1: at line 1, in Alt: + assert r0; + ^ + +- |+ + 0: at line 1, in Tag: + neg r0 into 3field; + ^ + + 1: at line 1, in Alt: + neg r0 into 3field; + ^ + diff --git a/synthesizer/tests/tests/parser/instruction/instruction_fail.aleo b/synthesizer/tests/tests/parser/instruction/instruction_fail.aleo index b98ee4c6e5..d7356d404e 100644 --- a/synthesizer/tests/tests/parser/instruction/instruction_fail.aleo +++ b/synthesizer/tests/tests/parser/instruction/instruction_fail.aleo @@ -1,2 +1,8 @@ floo r0 r1 into r2; add s0 r1 into r3; +hash.bhp2048 r0 into r1 as field; +hash.pds2 r0 into r1 as field; +commit.ped128 r0 r1 into r2; +add_w r0 r1 into r2; +assert r0; +neg r0 into 3field;