Added some tests.

This commit is contained in:
chriseth 2018-10-24 14:29:33 +02:00
parent 19be6cd818
commit a9a414bd0f
4 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,13 @@
contract C {
function f() public pure {
assembly {
function f(a, b) {}
f()
f(1,)
f(,1)
}
}
}
// ----
// ParserError: (113-114): Literal, identifier or instruction expected.
// ParserError: (113-114): Expected primary expression.

View File

@ -0,0 +1,10 @@
contract C {
function f() public pure {
assembly {
function (a, b) {}
}
}
}
// ----
// ParserError: (72-73): Expected identifier but got '('
// ParserError: (79-80): Expected ';' but got '{'

View File

@ -0,0 +1,10 @@
contract C {
function f() public pure {
assembly {
let x := 0100
}
}
}
// ----
// ParserError: (72-73): Literal, identifier or instruction expected.
// ParserError: (72-73): Expected primary expression.

View File

@ -0,0 +1,11 @@
contract C {
function f() public pure {
assembly {
let x := mload(0)
:= 1
}
}
}
// ----
// ParserError: (87-88): Literal, identifier or instruction expected.
// ParserError: (87-88): Expected primary expression.