Bug 16985 – Enable runnable unittest on dlang.org after 2.073 release

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-12-19T17:09:00Z
Last change time
2017-06-15T05:47:16Z
Assigned to
alexandru.razvan.c
Creator
greeenify

Comments

Comment #0 by greeenify — 2016-12-19T17:09:21Z
With https://github.com/dlang/dlang.org/pull/1297 running unittest directly on dlang.org is supported. However, to have a smooth start it has only been enabled for /phobos-prerelease Moreover, the added imports to the unittest blocks need to propagate to stable, so on the next release (2.073) enabling the runnable unittest option for all supported modules could be attempted. 1) At the moment the js/run_examples script is injected via the navbar: https://github.com/dlang/dlang.org/blob/master/std_navbar-prerelease.ddoc#L15 After 2.073 it can be moved to a more general place 2) It seems that the simple regex to rewrite assert's into writeln isn't good enough for more non-trivial cases, e.g. it has problems with the following: assert(!find!("toLower(a) == b")(s, "hello").empty); -> writeln(!find!("toLower(a)); // b")(s, "hello").empty https://dlang.org/phobos-prerelease/std_algorithm_searching.html#find https://github.com/dlang/phobos/blob/master/std/algorithm/searching.d#L1498 3) Related: Extend the list of runnable modules: https://issues.dlang.org/show_bug.cgi?id=16984
Comment #1 by greensunny12 — 2017-06-15T05:47:16Z