digitalmars.D.learn - DUB test and strings that look like D code
- 0xEAB (24/24) Mar 04 2023 Is it just me, or does this happen for someone else, too?
- Richard (Rikki) Andrew Cattermole (2/2) Mar 04 2023 The analysis is pretty brain dead.
Is it just me, or does this happen for someone else, too? Init a fresh DUB project and create a file (e.g. `lib.d`) with the following content: ```d unittest { string x = "module oh.dear.dub.what.are.you.doing;"; } ``` Then run `dub test`: ``` .dub/code/foo-test-library-unittest-linux.posix-x86_64-ldc_v1.31.0-E3344CC6C11D674C408FBF98D8EEFA551F60B915102F9E22FF0F316715677AD5/du _test_root.d(3,15): Error: unable to read module `doing` .dub/code/foo-test-library-unittest-linux.posix-x86_64-ldc_v1.31.0-E3344CC6C11D674C408FBF98D8EEFA551F60B915102F9E22FF0F316715677AD5/du _test_root.d(3,15): Expected 'oh/dear/dub/what/are/you/doing.d' or 'oh/dear/dub/what/are/you/doing/package.d' in one of the following import paths: import path[0] = source/ import path[1] = .dub/code/foo-test-library-unittest-linux.posix-x86_64-ldc_v1.31.0-E3344CC6C11D674C408FBF98D8EEFA551F60B915102F9E22FF0F316715677AD5 import path[2] = /opt/ldc/bin/../import ``` The DUB-generated test program: ```d module dub_test_root; import std.typetuple; static import oh.dear.dub.what.are.you.doing; // […] ```
Mar 04 2023
The analysis is pretty brain dead. https://github.com/dlang/dub/blob/master/source/dub/internal/utils.d#L611
Mar 04 2023