Probably a trivial question regarding version identifier and unittest

WhatMeWorry kheaser at gmail.com
Tue May 12 01:54:49 UTC 2020


I'm trying to study Adam Ruppe's terminal.d sub-package and I see 
the following code segment:

version(demos) unittest
{
     import arsd.terminal;

     void main()
     {
         // . . .
     }

     main; // exclude from docs
}

Looks like a good baby step to take, so in the command line I use:

C:\dub\path\to\arsdpackage\arsd-official>dmd terminal.d -unittest 
-version=demos
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Warning 134: No Start Address


Shouldn't the version identifier demos and the unittest option 
activate the test block and therefore defines main() which then 
give the "Start Address"?

Also, what is the isolated main; command right after the main 
function?






More information about the Digitalmars-d-learn mailing list