mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into HEAD
This commit is contained in:
@@ -70,6 +70,8 @@ BOOST_AUTO_TEST_CASE(positive_range)
|
||||
{"*", "1.2.3-foo"},
|
||||
{"1.0.0 - 2.0.0", "1.2.3"},
|
||||
{"1.0.0", "1.0.0"},
|
||||
{"1.0", "1.0.0"},
|
||||
{"1", "1.0.0"},
|
||||
{">=*", "0.2.4"},
|
||||
{"*", "1.2.3"},
|
||||
{">=1.0.0", "1.0.0"},
|
||||
@@ -82,6 +84,8 @@ BOOST_AUTO_TEST_CASE(positive_range)
|
||||
{"<=2.0.0", "0.2.9"},
|
||||
{"<2.0.0", "1.9999.9999"},
|
||||
{"<2.0.0", "0.2.9"},
|
||||
{"<1.0", "1.0.0-pre"},
|
||||
{"<1", "1.0.0-pre"},
|
||||
{">= 1.0.0", "1.0.0"},
|
||||
{">= 1.0.0", "1.0.1"},
|
||||
{">= 1.0.0", "1.1.0"},
|
||||
@@ -137,6 +141,10 @@ BOOST_AUTO_TEST_CASE(positive_range)
|
||||
{"^0.1.2", "0.1.2"},
|
||||
{"^0.1", "0.1.2"},
|
||||
{"^1.2", "1.4.2"},
|
||||
{"^1.2", "1.2.1-pre"},
|
||||
{"^1.2", "1.2.0"},
|
||||
{"^1", "1.2.0-pre"},
|
||||
{"^1", "1.2.0"},
|
||||
{"<=1.2.3", "1.2.3-beta"},
|
||||
{">1.2", "1.3.0-beta"},
|
||||
{"<1.2.3", "1.2.3-beta"},
|
||||
@@ -158,6 +166,8 @@ BOOST_AUTO_TEST_CASE(negative_range)
|
||||
// Positive range tests
|
||||
vector<pair<string, string>> tests = {
|
||||
{"1.0.0 - 2.0.0", "2.2.3"},
|
||||
{"1.0", "1.0.0-pre"},
|
||||
{"1", "1.0.0-pre"},
|
||||
{"^1.2.3", "1.2.3-pre"},
|
||||
{"^1.2", "1.2.0-pre"},
|
||||
{"^1.2.3", "1.2.3-beta"},
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
contract C {
|
||||
uint constant a = 2;
|
||||
uint constant aa = a;
|
||||
uint constant aaa = aa;
|
||||
bytes2 constant b = 0xabcd;
|
||||
bytes2 constant bb = b;
|
||||
bytes3 constant c = "abc";
|
||||
bytes3 constant cc = c;
|
||||
bytes3 constant ccc = cc;
|
||||
bytes3 constant cccc = ccc;
|
||||
bool constant d = true;
|
||||
bool constant dd = d;
|
||||
address payable constant e = 0x1212121212121212121212121212121212121212;
|
||||
address payable constant ee = e;
|
||||
function f() public pure returns (uint w, bytes2 x, bytes3 y, bool z, address t) {
|
||||
assembly {
|
||||
w := aaa
|
||||
x := bb
|
||||
y := cccc
|
||||
z := dd
|
||||
t := ee
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f() -> 2, left(0xabcd), left(0x616263), true, 0x1212121212121212121212121212121212121212
|
||||
@@ -7,4 +7,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (115-116): Only direct number constants are supported by inline assembly.
|
||||
// TypeError: (115-116): Only direct number constants and references to such constants are supported by inline assembly.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
bytes32 constant x = keccak256("abc");
|
||||
bytes32 constant y = x;
|
||||
function f() public pure returns (uint t) {
|
||||
assembly {
|
||||
t := y
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (168-169): Only direct number constants and references to such constants are supported by inline assembly.
|
||||
@@ -8,4 +8,3 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (134-135): Only direct number constants are supported by inline assembly.
|
||||
|
||||
Reference in New Issue
Block a user