On Thursday, 11 July 2019 at 09:43:55 UTC, BoQsc wrote:
Here I have a file named: module.d
import std.stdio : writeln;
There is no main() function since, I want to import this
module, into another .d file.
( If I try to import and module.d does have main() function I
get this error: )
otherFile.d(13): Error: only one main, WinMain, or DllMain
allowed. Previously found main at module.d(3)
I would like to launch function "interestingFunction()"
directly using rdmd.
Is it possible to achieve that by any way?
I tried to launch the whole file, but it gave me some weird
C:\Users\User\Desktop\Environment variables>rdmd module.d
OPTLINK (R) for Win32 Release 8.00.17
Copyright (C) Digital Mars 1989-2013 All rights reserved.
OPTLINK : Warning 134: No Start Address
If you are trying to test a function separately from other
functions, e.g. for testing, then you are approaching unit
You could write a unit test block just under the function to test
and launch it via rdmd... don't know the syntax right now. But
here is something:
So, I assume something like
rdmd -unittest --main module.d