mirror of
https://github.com/dlang/tools.git
synced 2025-04-28 22:21:14 +03:00
Verify default compiler in help text matches given default compiler
This commit is contained in:
parent
9a03b14dd9
commit
0aeb69a84b
1 changed files with 12 additions and 0 deletions
12
rdmd_test.d
12
rdmd_test.d
|
@ -140,6 +140,18 @@ void runCompilerAgnosticTests(string rdmdApp, string defaultCompiler, string mod
|
|||
assert(res.status == 0, res.output);
|
||||
assert(res.output.canFind("Usage: rdmd [RDMD AND DMD OPTIONS]... program [PROGRAM OPTIONS]..."));
|
||||
|
||||
string helpText = res.output;
|
||||
|
||||
// verify help text matches expected defaultCompiler
|
||||
{
|
||||
enum compilerHelpLine = " --compiler=comp use the specified compiler (e.g. gdmd) instead of ";
|
||||
auto offset = helpText.indexOf(compilerHelpLine);
|
||||
assert(offset >= 0);
|
||||
auto compilerInHelp = helpText[offset + compilerHelpLine.length .. $];
|
||||
compilerInHelp = compilerInHelp[0 .. compilerInHelp.indexOf('\n')];
|
||||
assert(defaultCompiler.baseName == compilerInHelp);
|
||||
}
|
||||
|
||||
// run the fallback compiler test (this involves
|
||||
// searching for the default compiler, so cannot
|
||||
// be run with other test compilers)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue