Re: unittest compiles w/o error though module file is not named after the module

2021-02-06 Thread ag0aep6g via Digitalmars-d-learn
On 06.02.21 16:05, kdevel wrote: On Saturday, 6 February 2021 at 14:52:57 UTC, Adam D. Ruppe wrote: [...] That one `import p;` is kinda weird, it should probably complain then you imported one thing and got another, but generally the name not matching is no problem at all. ```main.d

Re: unittest compiles w/o error though module file is not named after the module

2021-02-06 Thread kdevel via Digitalmars-d-learn
On Saturday, 6 February 2021 at 14:52:57 UTC, Adam D. Ruppe wrote: [...] That one `import p;` is kinda weird, it should probably complain then you imported one thing and got another, but generally the name not matching is no problem at all. ```main.d (version 2) // import x; unittest { //

Re: unittest compiles w/o error though module file is not named after the module

2021-02-06 Thread Adam D. Ruppe via Digitalmars-d-learn
Module names and file names are completely independent on the language level. You can have a file `whatever.d` with `module foo.bar.totally.different;` and `import foo.bar.totally.different` and it all works as long as you add the whatever.d to the build. The only reason people recommend