DUB test and strings that look like D code

0xEAB desisma at heidel.beer
Sat Mar 4 20:28:55 UTC 2023


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/dub_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/dub_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;
// […]
```


More information about the Digitalmars-d-learn mailing list