1 module rfc2069; 2 3 public import vibe.http.auth.digest_auth; 4 5 version (unittest) 6 { 7 void safelog(string msg) @trusted @nogc nothrow 8 { 9 import core.stdc.stdio : printf; 10 11 printf("%.*s\n", msg.length, &msg[0]); 12 } 13 14 void testFunctionality()() 15 { 16 import vibe.http.common : HTTPMethod; 17 18 createDigestAuthHeader(HTTPMethod.GET, "https://example.com", "username", "password", DigestAuthParams.init); 19 } 20 21 unittest 22 { 23 testFunctionality(); 24 safelog("package works"); 25 } 26 27 @safe unittest 28 { 29 static if (__traits(compiles, testFunctionality())) 30 { 31 pragma(msg, "package is @safe"); 32 } 33 else 34 { 35 pragma(msg, "package is not @safe"); 36 } 37 } 38 39 @nogc unittest 40 { 41 static if (__traits(compiles, testFunctionality())) 42 { 43 pragma(msg, "package is @nogc"); 44 } 45 else 46 { 47 pragma(msg, "package is not @nogc"); 48 } 49 } 50 51 nothrow unittest 52 { 53 static if (__traits(compiles, testFunctionality())) 54 { 55 pragma(msg, "package is nothrow"); 56 } 57 else 58 { 59 pragma(msg, "package is not nothrow"); 60 } 61 } 62 }