mirror of
https://github.com/dlang/phobos.git
synced 2025-05-12 23:29:01 +03:00
Sort multiple packages within one line
This commit is contained in:
parent
998ad51fd7
commit
2070d867dd
14 changed files with 30 additions and 30 deletions
|
@ -165,7 +165,7 @@ if (isBidirectionalRange!Range)
|
|||
@safe unittest
|
||||
{
|
||||
import std.algorithm.comparison : equal;
|
||||
import std.stdio, std.range;
|
||||
import std.range, std.stdio;
|
||||
import std.typecons : tuple;
|
||||
|
||||
ulong counter = 0;
|
||||
|
|
|
@ -1911,7 +1911,7 @@ if (((ss == SwapStrategy.unstable && (hasSwappableElements!Range ||
|
|||
@safe unittest
|
||||
{
|
||||
// Simple regression benchmark
|
||||
import std.random, std.algorithm.iteration, std.algorithm.mutation;
|
||||
import std.algorithm.iteration, std.algorithm.mutation, std.random;
|
||||
Random rng;
|
||||
int[] a = iota(20148).map!(_ => uniform(-1000, 1000, rng)).array;
|
||||
static uint comps;
|
||||
|
@ -2833,7 +2833,7 @@ private template TimSortImpl(alias pred, R)
|
|||
@safe unittest
|
||||
{
|
||||
// Issue 14223
|
||||
import std.range, std.array;
|
||||
import std.array, std.range;
|
||||
auto arr = chain(iota(0, 384), iota(0, 256), iota(0, 80), iota(0, 64), iota(0, 96)).array;
|
||||
sort!("a < b", SwapStrategy.stable)(arr);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ import std.traits;
|
|||
@system unittest
|
||||
{
|
||||
//Generating the hashes of a file, idiomatic D way
|
||||
import std.digest.crc, std.digest.sha, std.digest.md;
|
||||
import std.digest.crc, std.digest.md, std.digest.sha;
|
||||
import std.stdio;
|
||||
|
||||
// Digests a file and prints the result.
|
||||
|
@ -115,7 +115,7 @@ import std.traits;
|
|||
@system unittest
|
||||
{
|
||||
//Generating the hashes of a file using the template API
|
||||
import std.digest.crc, std.digest.sha, std.digest.md;
|
||||
import std.digest.crc, std.digest.md, std.digest.sha;
|
||||
import std.stdio;
|
||||
// Digests a file and prints the result.
|
||||
void digestFile(Hash)(ref Hash hash, string filename)
|
||||
|
@ -154,7 +154,7 @@ import std.traits;
|
|||
///
|
||||
@system unittest
|
||||
{
|
||||
import std.digest.crc, std.digest.sha, std.digest.md;
|
||||
import std.digest.crc, std.digest.md, std.digest.sha;
|
||||
import std.stdio;
|
||||
|
||||
// Digests a file and prints the result.
|
||||
|
@ -405,7 +405,7 @@ if (isDigest!T)
|
|||
///
|
||||
@system unittest
|
||||
{
|
||||
import std.digest.md, std.digest.hmac;
|
||||
import std.digest.hmac, std.digest.md;
|
||||
static assert(hasBlockSize!MD5 && MD5.blockSize == 512);
|
||||
static assert(hasBlockSize!(HMAC!MD5) && HMAC!MD5.blockSize == 512);
|
||||
}
|
||||
|
@ -468,7 +468,7 @@ if (allSatisfy!(isArray, typeof(data)))
|
|||
///
|
||||
@system unittest
|
||||
{
|
||||
import std.digest.md, std.digest.sha, std.digest.crc;
|
||||
import std.digest.crc, std.digest.md, std.digest.sha;
|
||||
auto md5 = digest!MD5( "The quick brown fox jumps over the lazy dog");
|
||||
auto sha1 = digest!SHA1( "The quick brown fox jumps over the lazy dog");
|
||||
auto crc32 = digest!CRC32("The quick brown fox jumps over the lazy dog");
|
||||
|
@ -641,7 +641,7 @@ interface Digest
|
|||
///
|
||||
@system unittest
|
||||
{
|
||||
import std.digest.md, std.digest.sha, std.digest.crc;
|
||||
import std.digest.crc, std.digest.md, std.digest.sha;
|
||||
ubyte[] md5 = (new MD5Digest()).digest("The quick brown fox jumps over the lazy dog");
|
||||
ubyte[] sha1 = (new SHA1Digest()).digest("The quick brown fox jumps over the lazy dog");
|
||||
ubyte[] crc32 = (new CRC32Digest()).digest("The quick brown fox jumps over the lazy dog");
|
||||
|
|
|
@ -33,7 +33,7 @@ version(StdDdoc)
|
|||
/// Computes an HMAC over data read from stdin.
|
||||
@safe unittest
|
||||
{
|
||||
import std.stdio, std.digest.hmac, std.digest.sha;
|
||||
import std.digest.hmac, std.digest.sha, std.stdio;
|
||||
import std.string : representation;
|
||||
|
||||
auto secret = "secret".representation;
|
||||
|
@ -89,7 +89,7 @@ if (hashBlockSize % 8 == 0)
|
|||
///
|
||||
@safe pure nothrow @nogc unittest
|
||||
{
|
||||
import std.digest.sha, std.digest.hmac;
|
||||
import std.digest.hmac, std.digest.sha;
|
||||
import std.string : representation;
|
||||
auto hmac = HMAC!SHA1("My s3cR3T keY".representation);
|
||||
hmac.put("Hello, world".representation);
|
||||
|
@ -126,7 +126,7 @@ if (hashBlockSize % 8 == 0)
|
|||
///
|
||||
@safe pure nothrow @nogc unittest
|
||||
{
|
||||
import std.digest.sha, std.digest.hmac;
|
||||
import std.digest.hmac, std.digest.sha;
|
||||
import std.string : representation;
|
||||
string data1 = "Hello, world", data2 = "Hola mundo";
|
||||
auto hmac = HMAC!SHA1("My s3cR3T keY".representation);
|
||||
|
@ -157,7 +157,7 @@ if (hashBlockSize % 8 == 0)
|
|||
///
|
||||
@safe pure nothrow @nogc unittest
|
||||
{
|
||||
import std.digest.sha, std.digest.hmac;
|
||||
import std.digest.hmac, std.digest.sha;
|
||||
import std.string : representation;
|
||||
string data1 = "Hello, world", data2 = "Hola mundo";
|
||||
auto hmac = HMAC!SHA1("My s3cR3T keY".representation);
|
||||
|
@ -193,7 +193,7 @@ if (hashBlockSize % 8 == 0)
|
|||
///
|
||||
@safe pure nothrow @nogc unittest
|
||||
{
|
||||
import std.digest.sha, std.digest.hmac;
|
||||
import std.digest.hmac, std.digest.sha;
|
||||
import std.string : representation;
|
||||
string data1 = "Hello, world", data2 = "Hola mundo";
|
||||
auto hmac = HMAC!SHA1("My s3cR3T keY".representation);
|
||||
|
@ -234,7 +234,7 @@ if (isDigest!H)
|
|||
///
|
||||
@safe pure nothrow @nogc unittest
|
||||
{
|
||||
import std.digest.sha, std.digest.hmac;
|
||||
import std.digest.hmac, std.digest.sha;
|
||||
import std.string : representation;
|
||||
string data1 = "Hello, world", data2 = "Hola mundo";
|
||||
auto digest = hmac!SHA1("My s3cR3T keY".representation)
|
||||
|
@ -269,7 +269,7 @@ if (isDigest!H)
|
|||
@system pure nothrow @nogc unittest
|
||||
{
|
||||
import std.algorithm.iteration : map;
|
||||
import std.digest.sha, std.digest.hmac;
|
||||
import std.digest.hmac, std.digest.sha;
|
||||
import std.string : representation;
|
||||
string data = "Hello, world";
|
||||
auto digest = data.representation
|
||||
|
|
|
@ -2996,7 +2996,7 @@ private void trustedStore(T)(ref shared T dst, ref T src) @trusted
|
|||
// to shared logger
|
||||
@system unittest
|
||||
{
|
||||
import std.concurrency, core.atomic, core.thread;
|
||||
import core.atomic, core.thread, std.concurrency;
|
||||
|
||||
static shared logged_count = 0;
|
||||
|
||||
|
|
|
@ -661,7 +661,7 @@ template unwrap(Target)
|
|||
@system unittest
|
||||
{
|
||||
// Bugzilla 10377
|
||||
import std.range, std.algorithm;
|
||||
import std.algorithm, std.range;
|
||||
|
||||
interface MyInputRange(T)
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ Source: $(PHOBOSSRC std/_file.d)
|
|||
*/
|
||||
module std.file;
|
||||
|
||||
import core.stdc.stdlib, core.stdc.string, core.stdc.errno;
|
||||
import core.stdc.errno, core.stdc.stdlib, core.stdc.string;
|
||||
|
||||
import std.datetime;
|
||||
import std.internal.cstring;
|
||||
|
|
|
@ -106,7 +106,7 @@ template unaryFun(alias fun, string parmName = "a")
|
|||
static if (!fun._ctfeMatchUnary(parmName))
|
||||
{
|
||||
import std.algorithm, std.conv, std.exception, std.math, std.range, std.string;
|
||||
import std.traits, std.typecons, std.meta;
|
||||
import std.meta, std.traits, std.typecons;
|
||||
}
|
||||
auto unaryFun(ElementType)(auto ref ElementType __a)
|
||||
{
|
||||
|
@ -191,7 +191,7 @@ template binaryFun(alias fun, string parm1Name = "a",
|
|||
static if (!fun._ctfeMatchBinary(parm1Name, parm2Name))
|
||||
{
|
||||
import std.algorithm, std.conv, std.exception, std.math, std.range, std.string;
|
||||
import std.traits, std.typecons, std.meta;
|
||||
import std.meta, std.traits, std.typecons;
|
||||
}
|
||||
auto binaryFun(ElementType1, ElementType2)
|
||||
(auto ref ElementType1 __a, auto ref ElementType2 __b)
|
||||
|
|
|
@ -3476,7 +3476,7 @@ import core.thread;
|
|||
|
||||
version (Windows)
|
||||
{
|
||||
import std.format, std.random, std.file;
|
||||
import std.file, std.format, std.random;
|
||||
}
|
||||
version (Posix)
|
||||
{
|
||||
|
@ -3484,7 +3484,7 @@ version (Posix)
|
|||
}
|
||||
version (unittest)
|
||||
{
|
||||
import std.file, std.conv, std.random;
|
||||
import std.conv, std.file, std.random;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ module std.regex.internal.backtracking;
|
|||
|
||||
package(std.regex):
|
||||
|
||||
import std.range.primitives, std.typecons, std.traits, core.stdc.stdlib;
|
||||
import core.stdc.stdlib, std.range.primitives, std.traits, std.typecons;
|
||||
import std.regex.internal.ir;
|
||||
|
||||
/+
|
||||
|
|
|
@ -9,7 +9,7 @@ module std.regex.internal.ir;
|
|||
|
||||
package(std.regex):
|
||||
|
||||
import std.exception, std.uni, std.meta, std.traits, std.range.primitives;
|
||||
import std.exception, std.meta, std.range.primitives, std.traits, std.uni;
|
||||
|
||||
debug(std_regex_parser) import std.stdio;
|
||||
// just a common trait, may be moved elsewhere
|
||||
|
|
|
@ -296,9 +296,9 @@ Macros:
|
|||
+/
|
||||
module std.regex;
|
||||
|
||||
import std.range.primitives, std.traits;
|
||||
import std.regex.internal.ir;
|
||||
import std.regex.internal.thompson; //TODO: get rid of this dependency
|
||||
import std.traits, std.range.primitives;
|
||||
import std.typecons; // : Flag, No, Yes;
|
||||
|
||||
/++
|
||||
|
@ -418,7 +418,7 @@ if (isSomeString!(S))
|
|||
|
||||
template ctRegexImpl(alias pattern, string flags=[])
|
||||
{
|
||||
import std.regex.internal.parser, std.regex.internal.backtracking;
|
||||
import std.regex.internal.backtracking, std.regex.internal.parser;
|
||||
enum r = regex(pattern, flags);
|
||||
alias Char = BasicElementOf!(typeof(pattern));
|
||||
enum source = ctGenRegExCode(r);
|
||||
|
@ -1422,7 +1422,7 @@ if (isOutputRange!(Sink, dchar) && isSomeString!R && isRegexFor!(RegEx, R))
|
|||
@system unittest
|
||||
{
|
||||
// insert comma as thousands delimiter in fifty randomly produced big numbers
|
||||
import std.array, std.random, std.conv, std.range;
|
||||
import std.array, std.conv, std.random, std.range;
|
||||
static re = regex(`(?<=\d)(?=(\d\d\d)+\b)`, "g");
|
||||
auto sink = appender!(char [])();
|
||||
enum ulong min = 10UL ^^ 10, max = 10UL ^^ 19;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
module std.socket;
|
||||
|
||||
import core.stdc.stdint, core.stdc.string, std.string, core.stdc.stdlib, std.conv;
|
||||
import core.stdc.stdint, core.stdc.stdlib, core.stdc.string, std.conv, std.string;
|
||||
|
||||
import core.stdc.config;
|
||||
import core.time : dur, Duration;
|
||||
|
|
|
@ -852,8 +852,8 @@ debug(print)
|
|||
assert(zip3.directory["foo"].compressedSize == am1.compressedSize);
|
||||
|
||||
// Test if packing and unpacking produces the original data
|
||||
import std.conv, std.stdio;
|
||||
import std.random : MinstdRand0, uniform;
|
||||
import std.stdio, std.conv;
|
||||
MinstdRand0 gen;
|
||||
const uint itemCount = 20, minSize = 10, maxSize = 500;
|
||||
foreach (variant; 0 .. 2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue