1 scope(failure) {writefln("Unittest failure :%s(%s)", __FILE__, __LINE__); stdout.flush();} 2 scope(success) {writefln("Unittest success :%s(%s)", __FILE__, __LINE__); stdout.flush();} 3 4 auto arr = [0, 1, 2, 3].repeatStream, 5 flt1 = arr.firFilter([0, 1]); 6 7 assert(flt1.read(new int[8]) == [0, 0, 0*1+1*0, 1, 2, 3, 0, 1]); 8 9 auto flt2 = arr.firFilter([1, 2]); 10 assert(flt2.read(new int[6]) == [0, 0, 0*2+1*1, 1*2+2*1, 2*2+3*1, 3*2+0*1]);