diff --git a/test/issue_2051_running_unittests_from_dub_single_file_packages_fails.d b/test/issue_2051_running_unittests_from_dub_single_file_packages_fails.d index e0bfab3..3769892 100644 --- a/test/issue_2051_running_unittests_from_dub_single_file_packages_fails.d +++ b/test/issue_2051_running_unittests_from_dub_single_file_packages_fails.d @@ -67,5 +67,33 @@ else writeln("\nOk. Unittest passed."); - return rc1; + // Check if dub `test` command runs unittests for single file package + { + filename = tempDir.buildPath("issue2051_fail.d"); + auto f = File(filename, "w"); + f.write( +`#!/usr/bin/env dub +/+ dub.sdl: + name "issue2051" ++/ + +version(unittest) {} +else void main() +{ +} + +unittest +{ + assert(0); +} +` ); + } + + const rc2 = text(dub, " test --single ", filename).executeCommand; + if (rc2) + writeln("\nOk. Unittests failed."); + else + writeln("\nError. Unittest passed."); + + return rc1 | !rc2; } \ No newline at end of file