diff options
| author | ruki <[email protected]> | 2020-07-25 23:22:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-07-25 23:22:11 +0800 |
| commit | 9444d665d8ed9f2a23c265ffe6dacecda2485820 (patch) | |
| tree | 9eaec0b8a4665fd7fe07a16c3ac82c390b5b8fb6 /tests/projects | |
| parent | 56c0819b70ee17f8f8f1f5d27d2f905ee34bb726 (diff) | |
support dub package manager
Diffstat (limited to 'tests/projects')
| -rw-r--r-- | tests/projects/dlang/console_with_pkgs/src/main.d | 10 | ||||
| -rw-r--r-- | tests/projects/dlang/console_with_pkgs/xmake.lua | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/projects/dlang/console_with_pkgs/src/main.d b/tests/projects/dlang/console_with_pkgs/src/main.d index 524c4f94c..39faa328e 100644 --- a/tests/projects/dlang/console_with_pkgs/src/main.d +++ b/tests/projects/dlang/console_with_pkgs/src/main.d @@ -1,6 +1,14 @@ import std.stdio; +import std.datetime; +import util.log; +import dateparser; void main() { - writeln("hello world!"); + log = Log(stderrLogger, stdoutLogger(LogLevel.info), fileLogger("log")); + log.info("hello xmake"); + + assert(parse("2003-09-25") == SysTime(DateTime(2003, 9, 25))); + assert(parse("09/25/2003") == SysTime(DateTime(2003, 9, 25))); + assert(parse("Sep 2003") == SysTime(DateTime(2003, 9, 1))); } diff --git a/tests/projects/dlang/console_with_pkgs/xmake.lua b/tests/projects/dlang/console_with_pkgs/xmake.lua index b1b8e0bfb..89592ecd5 100644 --- a/tests/projects/dlang/console_with_pkgs/xmake.lua +++ b/tests/projects/dlang/console_with_pkgs/xmake.lua @@ -1,6 +1,13 @@ add_rules("mode.debug", "mode.release") +add_requires("dub::log 0.4.3", {alias = "log"}) +add_requires("dub::dateparser", {alias = "dateparser"}) +add_requires("dub::emsi_containers", {alias = "emsi_containers"}) +add_requires("dub::stdx-allocator", {alias = "stdx-allocator"}) +add_requires("dub::mir-core", {alias = "mir-core"}) + target("test") set_kind("binary") add_files("src/*.d") + add_packages("log", "dateparser", "emsi_containers", "stdx-allocator", "mir-core") |
