diff --git a/dub.json b/dub.json index 02f7e87..6f64eb0 100644 --- a/dub.json +++ b/dub.json @@ -5,8 +5,7 @@ "authors": ["Szabo Bogdan"], "license": "MIT", "dependencies": { - "vibe-d": "~>0.7.30-beta.1", - "tested": "~>0.9.4" + "vibe-d": "~>0.7.30-beta.1" }, "targetType": "library" diff --git a/source/vibedav/base.d b/source/vibedav/base.d index 830d15b..4b6ffa5 100644 --- a/source/vibedav/base.d +++ b/source/vibedav/base.d @@ -30,7 +30,6 @@ import std.stdio; import std.typecons; import std.uri; import std.algorithm.sorting, std.algorithm.setops; -import tested; class DavStorage { static { @@ -96,7 +95,7 @@ Path getFilePath(Path baseUrlPath, Path basePath, URL url) { return basePath ~ filePath; } -@name("Basic getFilePath") +@("Basic getFilePath") unittest { auto path = getFilePath(Path("test/"), Path("/base/"), URL("http://127.0.0.1/test/file.txt")); assert(path.toString == "/base/file.txt"); diff --git a/source/vibedav/http.d b/source/vibedav/http.d index 97101c9..a4f2188 100644 --- a/source/vibedav/http.d +++ b/source/vibedav/http.d @@ -18,8 +18,6 @@ import vibe.core.file; import vibe.stream.operations; import vibe.utils.dictionarylist; -import tested; - debug { import std.stdio; } @@ -38,7 +36,7 @@ string getHeaderValue(HeaderList headers, string name, string defaultValue = "") return value; } -@name("basic check for getHeaderValue") +@("basic check for getHeaderValue") unittest { HeaderList list; list["key"] = "value"; @@ -46,14 +44,14 @@ unittest { assert(val == "value"); } -@name("getHeaderValue with default value") +@("getHeaderValue with default value") unittest { HeaderList list; auto val = getHeaderValue(list, "key", "default"); assert(val == "default"); } -@name("check if getHeaderValue fails") +@("check if getHeaderValue fails") unittest { bool raised = false; @@ -154,7 +152,7 @@ struct DavResponse { } } - @name("Test opIndex") + @("Test opIndex") unittest { DavResponse davResponse = DavResponse.Create; davResponse["test"] = "value"; diff --git a/source/vibedav/icalendar.d b/source/vibedav/icalendar.d index cd0e1a1..e6587ef 100644 --- a/source/vibedav/icalendar.d +++ b/source/vibedav/icalendar.d @@ -6,7 +6,6 @@ */ module vibedav.icalendar; -import tested; import std.string; import std.stdio; @@ -134,7 +133,7 @@ struct vEvent } } -@name("Set unique property") +@("Set unique property") unittest { vEvent event; @@ -144,7 +143,7 @@ unittest assert(event.toString == "BEGIN:VEVENT\nCLASS:value\nEND:VEVENT"); } -@name("Set unique property twice throw Exception") +@("Set unique property twice throw Exception") unittest { vEvent event; @@ -165,7 +164,7 @@ unittest assert(event.toString == "BEGIN:VEVENT\nCLASS:value1\nEND:VEVENT"); } -@name("Set optional properties") +@("Set optional properties") unittest { vEvent event; @@ -371,7 +370,7 @@ iCalendar parseICalendar(string data) return calendar; } -@name("Parse VEVENT") +@("Parse VEVENT") unittest { @@ -397,7 +396,7 @@ END:VCALENDAR"; assert(parsed.vEvents[0]["DTSTART"] == "20150401T000000Z"); } -@name("Parse VEVENT with timezone") +@("Parse VEVENT with timezone") unittest { diff --git a/source/vibedav/ifheader.d b/source/vibedav/ifheader.d index 2329f6c..b22f205 100644 --- a/source/vibedav/ifheader.d +++ b/source/vibedav/ifheader.d @@ -6,8 +6,6 @@ */ module vibedav.ifheader; -import tested; - import vibedav.parser; import std.stdio; @@ -166,7 +164,7 @@ struct IfHeader { } } -@name("No-Tag-List") +@("No-Tag-List") unittest { auto tag = IfHeader.parse("()"); @@ -174,7 +172,7 @@ unittest { assert(tag.has("", "urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf")); } -@name("Tagged-List") +@("Tagged-List") unittest { auto tag = IfHeader.parse(" () ()"); @@ -183,7 +181,7 @@ unittest { assert(tag.has("http://example.com/locked/", "other")); } -@name("Tagged-List") +@("Tagged-List") unittest { auto tag = IfHeader.parse(" ()"); @@ -191,7 +189,7 @@ unittest { assert(tag.has("http://example.com/locked/", "urn:uuid:150852e2-3847-42d5-8cbe-0f4f296f26cf")); } -@name("multiple conditions") +@("multiple conditions") unittest { auto tag = IfHeader.parse("() (Not )"); @@ -202,7 +200,7 @@ unittest { assert(!tag.hasNot("", "urn:uuid:181d4fae-7d8c-11d0-a765-00a0c91e6bf2")); } -@name("etag conditions") +@("etag conditions") unittest { auto tag = IfHeader.parse(`( ["C8E30A4F4684AB4A5053F6C1ACBA1023"])`); diff --git a/source/vibedav/plugins/caldav.d b/source/vibedav/plugins/caldav.d index 4aebbbd..0d912da 100644 --- a/source/vibedav/plugins/caldav.d +++ b/source/vibedav/plugins/caldav.d @@ -27,8 +27,6 @@ import std.typecons; import std.uri; import std.uuid; -import tested; - private bool matchPluginUrl(Path path, string username) { if(path.length < 2) { return false; diff --git a/source/vibedav/plugins/filedav.d b/source/vibedav/plugins/filedav.d index 3acfb4f..a276cdd 100644 --- a/source/vibedav/plugins/filedav.d +++ b/source/vibedav/plugins/filedav.d @@ -38,8 +38,6 @@ static if (__traits(compiles, { import std.algorithm.comparison : max; })) else import std.algorithm; -import tested: testName = name; - /// Compute a file etag string eTag(string path) { import std.digest.crc; diff --git a/source/vibedav/prop.d b/source/vibedav/prop.d index bd31077..5e686d5 100644 --- a/source/vibedav/prop.d +++ b/source/vibedav/prop.d @@ -32,9 +32,6 @@ import std.uuid; import core.thread; -import tested; - - class DavPropException : DavException { /// this(HTTPStatus status, string msg, string mime = "plain/text", string file = __FILE__, size_t line = __LINE__, Throwable next = null) @@ -390,20 +387,20 @@ DavProp[] getTagChilds(DavProp[] list, string key) { return result; } -@name("string prop") +@("string prop") unittest { auto prop = new DavProp("value"); assert(prop.to!string == "value"); } -@name("tag prop") +@("tag prop") unittest { auto prop = new DavProp; prop["name"] = "value"; assert(prop.toString == `value`); } -@name("check if tags can be accessed from other references") +@("check if tags can be accessed from other references") unittest { DavProp properties = new DavProp; auto prop = new DavProp("value"); @@ -415,7 +412,7 @@ unittest { assert(prop["sub"] == subProp); } -@name("remove child tags") +@("remove child tags") unittest { DavProp properties = new DavProp; @@ -428,7 +425,7 @@ unittest { assert(properties.length == 2); } -@name("filter tags by tag name") +@("filter tags by tag name") unittest { DavProp properties = new DavProp; auto prop1 = new DavProp; @@ -446,7 +443,7 @@ unittest { assert([ properties ].getTagChilds("prop") == [prop1, prop2]); } -@name("set tag value property") +@("set tag value property") unittest { auto prop = new DavProp; prop["name"] = "value"; @@ -455,7 +452,7 @@ unittest { assert(prop.toString == `value2`); } -@name("set namespace attr") +@("set namespace attr") unittest { auto prop = new DavProp; prop["name"] = "value"; @@ -464,7 +461,7 @@ unittest { assert(prop.toString == `value`); } -@name("set a tag namesapace prefix") +@("set a tag namesapace prefix") unittest { auto prop = new DavProp; prop["name"] = ""; @@ -473,7 +470,7 @@ unittest { assert(prop.toString == ``); } -@name("get tag prefix") +@("get tag prefix") unittest { auto prop = new DavProp; prop["name"] = ""; @@ -483,7 +480,7 @@ unittest { assert(prop["name"]["D:propname"].prefix == "D"); } -@name("add a tag with an unknown ns prefix") +@("add a tag with an unknown ns prefix") unittest { auto prop = new DavProp; prop["name"] = ""; @@ -500,7 +497,7 @@ unittest { assert(raised); } -@name("add same name tag with different ns") +@("add same name tag with different ns") unittest { auto prop = new DavProp; auto prop1 = new DavProp; @@ -521,7 +518,7 @@ unittest { assert(prop.length == 2); } -@name("get a namespace name from a prefixed tag") +@("get a namespace name from a prefixed tag") unittest { auto prop = new DavProp; prop.namespaces["D"] = "DAV:"; @@ -532,7 +529,7 @@ unittest { assert(prop["D:name"]["D:val"].namespace == "DAV:"); } -@name("create FromKey") +@("create FromKey") unittest { auto p = DavProp.FromKey("A:DAV:", "value"); @@ -541,7 +538,7 @@ unittest { assert(p.value == "value"); } -@name("create FromKeyAndList") +@("create FromKeyAndList") unittest { string[][string] value; value["href:DAV:"] = []; @@ -552,7 +549,7 @@ unittest { assert(p.toString == `value`); } -@name("attributes to string") +@("attributes to string") unittest { auto p = new DavProp("DAV:", "A"); p.attribute["name"] = "value"; @@ -813,13 +810,13 @@ DavProp parseXMLPropNode(string xmlNodeText, DavProp parent, ref ulong end) { return node; } -@name("parse a string without any tags") +@("parse a string without any tags") unittest { auto prop = parseXMLProp("value"); assert(prop.value == "value"); } -@name("parse a string with a tag") +@("parse a string with a tag") unittest { auto prop = parseXMLProp(`value`)[0]; assert(prop.value == "value"); @@ -827,7 +824,7 @@ unittest { assert(prop.toString == "value"); } -@name("parse a string without imbricated tags") +@("parse a string without imbricated tags") unittest { auto prop = parseXMLProp(`val1val2`); assert(prop["prop1"].value == "val1"); @@ -835,7 +832,7 @@ unittest { assert(prop.toString == "val1val2"); } -@name("parse a string with imbricated tags") +@("parse a string with imbricated tags") unittest { auto prop = parseXMLProp(`value`)[0]; @@ -844,7 +841,7 @@ unittest { assert(prop.toString == "value"); } -@name("check invalid namespaces") +@("check invalid namespaces") unittest { auto prop = parseXMLProp(`val1`)[0]; @@ -856,75 +853,75 @@ unittest { assert(raised); } -@name("check valid namespaces") +@("check valid namespaces") unittest { auto prop = parseXMLProp(`val`); prop.checkNamespacePrefixes; assert(prop.toString == `val`); } -@name("parse xml attribute") +@("parse xml attribute") unittest { auto prop = parseXMLProp(``)[0]; assert(prop.namespaceAttr == `DAV:`); } -@name("normalize xml string") +@("normalize xml string") unittest { auto text = normalize(`< cat xmlns = "DAV:" > < / cat >`); assert(text == ``); } -@name("normalize `/` and `<` in attr values") +@("normalize `/` and `<` in attr values") unittest { auto text = normalize(`< cat xmlns = " / < " > < / cat >`); assert(text == ``); } -@name("access nodes without passing the ns") +@("access nodes without passing the ns") unittest { auto prop = parseXMLProp(`value`)[0]; assert(prop.tagName == "tag1"); assert(prop["tag2"].value == "value"); } -@name("parse self closing tags") +@("parse self closing tags") unittest { auto prop = parseXMLProp(``)[0]; assert(prop.tagName == "a"); } -@name("check ?xml tag parsing") +@("check ?xml tag parsing") unittest { auto prop = parseXMLProp(``); assert(prop.toString == ``); } -@name("check if the parsing fails to check the parents") +@("check if the parsing fails to check the parents") unittest { auto prop = parseXMLProp(``); assert(prop.toString == ``); } -@name("check child names with similar name") +@("check child names with similar name") unittest { auto prop = parseXMLProp(``); assert(prop.toString == ``); } -@name("allow to have childrens with the same tag name") +@("allow to have childrens with the same tag name") unittest { auto prop = parseXMLProp(`c1c2`); assert(prop.toString == `c1c2`); } -@name("value given for tag with null ns") +@("value given for tag with null ns") unittest { auto prop = parseXMLProp(`randomvalue`); assert(prop.toString == `randomvalue`); } -@name("replace namespaces with prefixes") +@("replace namespaces with prefixes") unittest { auto prop = parseXMLProp(`randomvalue`); assert(prop.toString == `randomvalue`); diff --git a/test.d b/test.d index ebd95aa..169a8ac 100644 --- a/test.d +++ b/test.d @@ -2,7 +2,6 @@ import dub_test_root; import std.stdio; import core.runtime; -import testedatom; shared bool result; @@ -18,7 +17,6 @@ int main() { } shared static this() { - import tested; import core.runtime; import std.exception; Runtime.moduleUnitTester = () => true;