Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
200 stars 48 forks source link

Show warning for unittests inside templates #183

Open WebFreak001 opened 2 years ago

WebFreak001 commented 2 years ago

Should be big squiggles over the entire unittest, as unittests inside templates are never actually run

PetarKirov commented 2 years ago

There's a trick to make unit tests tested in templates run in a reasonable way (only once, not once per each template instantiation):

https://github.com/libmir/mir-algorithm/blob/e669f3161cd59918f913477f8332cc7f385f3ccf/source/mir/ndslice/slice.d#L721

https://github.com/libmir/mir-algorithm/blob/e669f3161cd59918f913477f8332cc7f385f3ccf/source/mir/ndslice/slice.d#L922-L941

WebFreak001 commented 2 years ago

hm I don't get it, how does it work / how does the unittest get run?