bitcoin-sv / sol2scrypt

Solidity to sCrypt Transplier
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

add golden tests #134

Closed xhliu closed 2 years ago

xhliu commented 2 years ago

Test for both pass & fail cases: https://github.com/sCrypt-Inc/compiler/tree/master/src/test-suite/golden/ast

E.g.,

--- a/examples/Coin/Coin.sol
+++ b/examples/Coin/Coin.sol
@@ -19,6 +19,12 @@ contract Coin {
     function mint(address receiver, uint amount) external {
         if (msg.sender != minter) return;
         balances[receiver] += amount;
+        for (uint i = 0; i < 3; i++) {
+            break;
+        }
+        for (uint i = 0; i < 3; i++) {
+            break;
+        }
     }

This should yield

Error: examples/Coin/Coin.sol:22:9:24:10
unsupported statement `ForStatement`

Error: examples/Coin/Coin.sol:25:9:27:10
unsupported statement `ForStatement`