Skip to content

Commit

Permalink
fixup! cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusaaguiar committed Jul 11, 2023
1 parent 79051aa commit fb133c3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
==== Source: A ====
contract C {
}
==== Source: B ====
import "A" as M;

contract C {
function f() public pure {
bool flag;
((flag = true) ? M : M).C;
}
}
// ----
// f() ->
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
contract C {
function f(bool flag) public pure returns (uint, uint, uint){
return (flag ? (1, 2, 3) : (3, 2, 1));
}
}
// ----
// f(bool): true -> 1, 2, 3
// f(bool): false -> 3, 2, 1

This file was deleted.

4 changes: 1 addition & 3 deletions test/libsolidity/syntaxTests/metaTypes/type_runtimecode.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
contract A {
function f() public {}
}

contract C {
function f() public returns (bytes memory) {
function f() public pure returns (bytes memory) {
return type(A).runtimeCode;
}
}
// ----
// Warning 2018: (60-146): Function state mutability can be restricted to pure
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
contract A {
function f() public {}
}

contract B {
function g() public {}
}

contract C {
Expand All @@ -12,5 +10,5 @@ contract C {
}
}
// ----
// TypeError 9717: (180-187): Invalid mobile type in true expression.
// TypeError 3703: (190-197): Invalid mobile type in false expression.
// TypeError 9717: (126-133): Invalid mobile type in true expression.
// TypeError 3703: (136-143): Invalid mobile type in false expression.

0 comments on commit fb133c3

Please sign in to comment.