File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -386,10 +386,7 @@ TestCase::TestResult SemanticTest::runTest(
386
386
// For convenience, in semantic tests we assume that an unqualified name like `L` is equivalent to one
387
387
// with an empty source unit name (`:L`). This is fine because the compiler never uses unqualified
388
388
// names in the Yul code it produces and does not allow `linkersymbol()` at all in inline assembly.
389
- if (test.call ().signature .find (' :' ) == string::npos)
390
- libraries[" :" + test.call ().signature ] = m_contractAddress;
391
- else
392
- libraries[test.call ().signature ] = m_contractAddress;
389
+ libraries[test.call ().libraryFile + " :" + test.call ().signature ] = m_contractAddress;
393
390
continue ;
394
391
}
395
392
else
Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ struct FunctionValue
268
268
struct FunctionCall
269
269
{
270
270
// / Signature of the function call, e.g. `f(uint256, uint256)`.
271
+ // / For a library deployment, this contains the library name.
271
272
std::string signature;
272
273
// / Optional value that can be sent with the call.
273
274
// / Value is expressed in wei, smallest unit of ether
@@ -313,6 +314,8 @@ struct FunctionCall
313
314
std::vector<std::string> expectedSideEffects{};
314
315
// / A textual representation of the actual side-effect of the function call.
315
316
std::vector<std::string> actualSideEffects{};
317
+ // / File name of the library. Always empty, unless this is a library deployment call.
318
+ std::string libraryFile{};
316
319
};
317
320
318
321
using Builtin = std::function<std::optional<bytes>(FunctionCall const &)>;
Original file line number Diff line number Diff line change @@ -107,15 +107,15 @@ vector<solidity::frontend::test::FunctionCall> TestFileParser::parseFunctionCall
107
107
string libraryName;
108
108
if (accept (Token::String))
109
109
{
110
- libraryName = m_scanner.currentLiteral ();
110
+ call. libraryFile = m_scanner.currentLiteral ();
111
111
expect (Token::String);
112
112
expect (Token::Colon);
113
- libraryName += ' : ' + m_scanner.currentLiteral ();
113
+ libraryName += m_scanner.currentLiteral ();
114
114
expect (Token::Identifier);
115
115
}
116
116
else if (accept (Token::Colon, true ))
117
117
{
118
- libraryName = ' : ' + m_scanner.currentLiteral ();
118
+ libraryName = m_scanner.currentLiteral ();
119
119
expect (Token::Identifier);
120
120
}
121
121
else
Original file line number Diff line number Diff line change @@ -58,7 +58,10 @@ string TestFunctionCall::format(
58
58
59
59
if (m_call.kind == FunctionCall::Kind::Library)
60
60
{
61
- stream << _linePrefix << newline << ws << " library:" << ws << m_call.signature ;
61
+ stream << _linePrefix << newline << ws << " library:" << ws;
62
+ if (!m_call.libraryFile .empty ())
63
+ stream << " \" " << m_call.libraryFile << " \" :" ;
64
+ stream << m_call.signature ;
62
65
return ;
63
66
}
64
67
You can’t perform that action at this time.
0 commit comments