Skip to content

Commit 157e1bb

Browse files
committed
Add better coverage for testing function selector purity.
1 parent 3631956 commit 157e1bb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/libsolidity/syntaxTests/types/functionTypes/selector/event_error_selector_pure_assignment.sol

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
1+
==== Source: A.sol ====
2+
3+
event EvAExt();
4+
error ErAExt();
5+
6+
contract A {
7+
event Ev();
8+
error Er();
9+
}
10+
11+
==== Source: C.sol ====
12+
import * as AMod from "A.sol";
13+
114
event EvExt();
215
error ErExt();
316

417
bytes32 constant eventExtSelectorGlobal = EvExt.selector;
518
bytes4 constant errorExtSelectorGlobal = ErExt.selector;
619

20+
bytes32 constant eventAExtSelectorGlobal = AMod.EvAExt.selector;
21+
bytes4 constant errorAExtSelectorGlobal = AMod.ErAExt.selector;
22+
23+
bytes32 constant eventASelectorGlobal = AMod.A.Ev.selector;
24+
bytes4 constant errorASelectorGlobal = AMod.A.Er.selector;
25+
726
contract C {
827
event Ev();
928
error Er();
@@ -16,5 +35,11 @@ contract C {
1635

1736
bytes4 constant errorSelectorC = C.Er.selector;
1837
bytes32 constant eventSelectorC = C.Ev.selector;
38+
39+
bytes32 constant eventAExtSelector = AMod.EvAExt.selector;
40+
bytes4 constant errorAExtSelector = AMod.ErAExt.selector;
41+
42+
bytes32 constant eventASelector = AMod.A.Ev.selector;
43+
bytes4 constant errorASelector = AMod.A.Er.selector;
1944
}
2045
// ----

0 commit comments

Comments
 (0)