But when compiling you should put all your custom modules on the command line.
dmd tests.d datastructures.dAnd that will solve it. Alternatively you can compile them separately then put all the .o files together to link, but the easiest way is to just list them at once.