From 16efa3a6c38372c044b4d03be7041be9f14ac203 Mon Sep 17 00:00:00 2001 From: "Harry T. Vennik" Date: Sun, 25 Jun 2017 18:30:34 +0200 Subject: [PATCH] Add unittest for ObjectPath --- source/ddbus/thin.d | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/ddbus/thin.d b/source/ddbus/thin.d index 944f3df..3268c6b 100644 --- a/source/ddbus/thin.d +++ b/source/ddbus/thin.d @@ -56,6 +56,17 @@ struct ObjectPath { } } +unittest { + import dunit.toolkit; + + ObjectPath("some.invalid/object_path").assertThrow(); + ObjectPath("/path/with/TrailingSlash/").assertThrow(); + string path = "/org/freedesktop/DBus"; + auto obj = ObjectPath(path); + obj.toString().assertEqual(path); + obj.toHash().assertEqual(path.hashOf); +} + /// Structure allowing typeless parameters struct DBusAny { /// DBus type of the value (never 'v'), see typeSig!T