diff options
author | chriseth <chris@ethereum.org> | 2018-10-24 20:29:33 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-10-24 20:29:33 +0800 |
commit | a9a414bd0f6ba89bfd719ea6b6c8501861e0ece6 (patch) | |
tree | a2d1e953a6d3ee326af4ad00fa75da43ac83e13a /test/libsolidity | |
parent | 19be6cd818e4bb1a49325d8bfea7f7727d85c933 (diff) | |
download | dexon-solidity-a9a414bd0f6ba89bfd719ea6b6c8501861e0ece6.tar.gz dexon-solidity-a9a414bd0f6ba89bfd719ea6b6c8501861e0ece6.tar.zst dexon-solidity-a9a414bd0f6ba89bfd719ea6b6c8501861e0ece6.zip |
Added some tests.
Diffstat (limited to 'test/libsolidity')
4 files changed, 44 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/inlineAssembly/invalid/empty_fun_arg.sol b/test/libsolidity/syntaxTests/inlineAssembly/invalid/empty_fun_arg.sol new file mode 100644 index 00000000..e05277de --- /dev/null +++ b/test/libsolidity/syntaxTests/inlineAssembly/invalid/empty_fun_arg.sol @@ -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. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/invalid/empty_function_name.sol b/test/libsolidity/syntaxTests/inlineAssembly/invalid/empty_function_name.sol new file mode 100644 index 00000000..17995b09 --- /dev/null +++ b/test/libsolidity/syntaxTests/inlineAssembly/invalid/empty_function_name.sol @@ -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 '{' diff --git a/test/libsolidity/syntaxTests/inlineAssembly/invalid/invalid_number.sol b/test/libsolidity/syntaxTests/inlineAssembly/invalid/invalid_number.sol new file mode 100644 index 00000000..715913de --- /dev/null +++ b/test/libsolidity/syntaxTests/inlineAssembly/invalid/invalid_number.sol @@ -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. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/invalid/missing_variable_in_assign.sol b/test/libsolidity/syntaxTests/inlineAssembly/invalid/missing_variable_in_assign.sol new file mode 100644 index 00000000..c8984333 --- /dev/null +++ b/test/libsolidity/syntaxTests/inlineAssembly/invalid/missing_variable_in_assign.sol @@ -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. |