What am I doing wrong?
Using rdmd. It assumes the filename will match the module name to locate the file, though the language itself doesn't require this.
What you want to do to make this work is use ordinary dmd and pass both files to it at the same time:
dmd aaa.d test.d and it will work then.