detab and remove trailing whitespaces

This commit is contained in:
k-hara 2015-02-10 00:56:40 +09:00
parent 799fdf81ad
commit e7b3d834d7
15 changed files with 58 additions and 58 deletions

View file

@ -660,34 +660,34 @@ unittest
+/ +/
T sqAbs(T)(Complex!T z) @safe pure nothrow @nogc T sqAbs(T)(Complex!T z) @safe pure nothrow @nogc
{ {
return z.re*z.re + z.im*z.im; return z.re*z.re + z.im*z.im;
} }
unittest unittest
{ {
import std.math; import std.math;
assert (sqAbs(complex(0.0)) == 0.0); assert (sqAbs(complex(0.0)) == 0.0);
assert (sqAbs(complex(1.0)) == 1.0); assert (sqAbs(complex(1.0)) == 1.0);
assert (sqAbs(complex(0.0, 1.0)) == 1.0); assert (sqAbs(complex(0.0, 1.0)) == 1.0);
assert (approxEqual(sqAbs(complex(1.0L, -2.0L)), 5.0L)); assert (approxEqual(sqAbs(complex(1.0L, -2.0L)), 5.0L));
assert (approxEqual(sqAbs(complex(-3.0L, 1.0L)), 10.0L)); assert (approxEqual(sqAbs(complex(-3.0L, 1.0L)), 10.0L));
assert (approxEqual(sqAbs(complex(1.0f,-1.0f)), 2.0f)); assert (approxEqual(sqAbs(complex(1.0f,-1.0f)), 2.0f));
} }
/// ditto /// ditto
T sqAbs(T)(T x) @safe pure nothrow @nogc T sqAbs(T)(T x) @safe pure nothrow @nogc
if (isFloatingPoint!T) if (isFloatingPoint!T)
{ {
return x*x; return x*x;
} }
unittest unittest
{ {
import std.math; import std.math;
assert (sqAbs(0.0) == 0.0); assert (sqAbs(0.0) == 0.0);
assert (sqAbs(-1.0) == 1.0); assert (sqAbs(-1.0) == 1.0);
assert (approxEqual(sqAbs(-3.0L), 9.0L)); assert (approxEqual(sqAbs(-3.0L), 9.0L));
assert (approxEqual(sqAbs(-5.0f), 25.0f)); assert (approxEqual(sqAbs(-5.0f), 25.0f));
} }

View file

@ -1353,7 +1353,7 @@ bool isValid(E)(const(E)[] s)
unittest unittest
{ {
assert( isValid("\u20AC100")); assert( isValid("\u20AC100"));
assert(!isValid(cast(char[3])[167, 133, 175])); assert(!isValid(cast(char[3])[167, 133, 175]));
} }
/** /**
@ -1467,7 +1467,7 @@ body
unittest unittest
{ {
assert(firstSequence("\u20AC1000") == "\u20AC".length); assert(firstSequence("\u20AC1000") == "\u20AC".length);
assert(firstSequence("hel") == "h".length); assert(firstSequence("hel") == "h".length);
} }
/** /**
@ -1498,7 +1498,7 @@ body
unittest unittest
{ {
assert(lastSequence("1000\u20AC") == "\u20AC".length); assert(lastSequence("1000\u20AC") == "\u20AC".length);
assert(lastSequence("hellö") == "ö".length); assert(lastSequence("hellö") == "ö".length);
} }
/** /**

View file

@ -2688,19 +2688,19 @@ struct HTTP
* Specify data to post when not using the onSend callback, with * Specify data to post when not using the onSend callback, with
* user-specified Content-Type. * user-specified Content-Type.
* Params: * Params:
* data = Data to post. * data = Data to post.
* contentType = MIME type of the data, for example, "text/plain" or * contentType = MIME type of the data, for example, "text/plain" or
* "application/octet-stream". See also: * "application/octet-stream". See also:
* $(LINK2 http://en.wikipedia.org/wiki/Internet_media_type, * $(LINK2 http://en.wikipedia.org/wiki/Internet_media_type,
* Internet media type) on Wikipedia. * Internet media type) on Wikipedia.
*----- * -----
* import std.net.curl; * import std.net.curl;
* auto http = HTTP("http://onlineform.example.com"); * auto http = HTTP("http://onlineform.example.com");
* auto data = "app=login&username=bob&password=s00perS3kret"; * auto data = "app=login&username=bob&password=s00perS3kret";
* http.setPostData(data, "application/x-www-form-urlencoded"); * http.setPostData(data, "application/x-www-form-urlencoded");
* http.onReceive = (ubyte[] data) { return data.length; }; * http.onReceive = (ubyte[] data) { return data.length; };
* http.perform(); * http.perform();
*----- * -----
*/ */
void setPostData(const(void)[] data, string contentType) void setPostData(const(void)[] data, string contentType)
{ {