1 module rfc7232; 2 3 public import vibe.http.fileserver; 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 std.typecons : Yes, No; 17 18 assert(cacheMatch(`"xyzzy","r2d2xxxx", "c3piozzzz"`, ETag(No.weak, "xyzzy"), No.allowWeak)); 19 assert(cacheMatch(`"xyzzy","r2d2xxxx", "c3piozzzz"`, ETag(No.weak, "xyzzy"), Yes.allowWeak)); 20 } 21 22 unittest 23 { 24 testFunctionality(); 25 safelog("package works"); 26 } 27 28 @safe unittest 29 { 30 static if (__traits(compiles, testFunctionality())) 31 { 32 pragma(msg, "package is @safe"); 33 } 34 else 35 { 36 pragma(msg, "package is not @safe"); 37 } 38 } 39 40 @nogc unittest 41 { 42 static if (__traits(compiles, testFunctionality())) 43 { 44 pragma(msg, "package is @nogc"); 45 } 46 else 47 { 48 pragma(msg, "package is not @nogc"); 49 } 50 } 51 52 nothrow unittest 53 { 54 static if (__traits(compiles, testFunctionality())) 55 { 56 pragma(msg, "package is nothrow"); 57 } 58 else 59 { 60 pragma(msg, "package is not nothrow"); 61 } 62 } 63 }