Skip to content

Commit

Permalink
refactoring: Sort imports
Browse files Browse the repository at this point in the history
gizmomogwai committed Dec 22, 2023
1 parent 4368c28 commit 6316447
Showing 3 changed files with 8 additions and 26 deletions.
5 changes: 1 addition & 4 deletions dub.sdl
Original file line number Diff line number Diff line change
@@ -7,8 +7,6 @@ license "MIT"
x:ddoxFilterArgs "--min-protection=Public"
x:ddoxTool "scod"

preGenerateCommands "$DC --version"

configuration "library" {
targetPath "out/lib"
excludedSourceFiles "source/testsuite.d"
@@ -19,8 +17,7 @@ configuration "unittest" {
targetName "unittest"
targetPath "out/test"

dependency "unit-threaded" version="~>2.1.2"
// dependency "color" version="~>0.0.9"
dependency "unit-threaded" version="~>2.1.7"

mainSourceFile "source/testsuite.d"
postRunCommands "$DUB run lst2errormessages || true"
3 changes: 1 addition & 2 deletions dub.selections.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"fileVersion": 1,
"versions": {
"color": "0.0.9",
"unit-threaded": "2.1.2"
"unit-threaded": "2.1.7"
}
}
26 changes: 6 additions & 20 deletions source/colored/package.d
Original file line number Diff line number Diff line change
@@ -9,13 +9,13 @@ module colored;

@safe:

import std.algorithm : map, filter, joiner;
import std.algorithm : filter, joiner, map;
import std.array : join, split;
import std.conv : to;
import std.format : format;
import std.functional : not;
import std.range : ElementType, empty, front, popFront;
import std.regex : ctRegex, Captures, replaceAll;
import std.regex : Captures, ctRegex, replaceAll;
import std.string : toUpper;
import std.traits : EnumMembers;

@@ -25,7 +25,8 @@ version (unittest)
import core.time : msecs;
import std.conv : to;
import std.process : environment;
import std.stdio : writeln, write;
import std.stdio : write, writeln;
import unit_threaded : should;
}
/// Available Colors
enum AnsiColor
@@ -181,9 +182,9 @@ string onRgb(string s, ubyte r, ubyte g, ubyte b)
/+
@system @("rgb") unittest
{
import unit_threaded;
import std.experimental.color : RGBA8, convertColor;
import std.experimental.color : convertColor, RGBA8;
import std.experimental.color.hsx : HSV;
import unit_threaded;
writeln("red: ", "r".rgb(255, 0, 0).onRgb(0, 255, 0));
writeln("green: ", "g".rgb(0, 255, 0).onRgb(0, 0, 255));
@@ -218,7 +219,6 @@ string onRgb(string s, ubyte r, ubyte g, ubyte b)

@system @("styledstring") unittest
{
import unit_threaded;

foreach (immutable color; [EnumMembers!AnsiColor])
{
@@ -242,7 +242,6 @@ string onRgb(string s, ubyte r, ubyte g, ubyte b)

@system @("styledstring ~") unittest
{
import unit_threaded;

("test".red ~ "blub").should == "\033[31mtest\033[0mblub";
}
@@ -286,8 +285,6 @@ mixin(styleMixin!Style);

@system @("api") unittest
{
import unit_threaded;

"redOnGreen".red.onGreen.writeln;
"redOnYellowBoldUnderlined".red.onYellow.bold.underlined.writeln;
"bold".bold.writeln;
@@ -421,8 +418,6 @@ auto tokenize(Range)(Range parts)

@system @("ansi tokenizer") unittest
{
import unit_threaded;

[38, 5, 2, 38, 2, 1, 2, 3, 36, 1, 2, 3, 4].tokenize.should == ([
[38, 5, 2], [38, 2, 1, 2, 3], [36], [1], [2], [3], [4]
]);
@@ -483,9 +478,6 @@ bool all(uint[])

@system @("configurable strip") unittest
{
import unit_threaded;
import std.functional : not;

"test".red
.onGreen
.bold
@@ -539,8 +531,6 @@ auto leftJustifyFormattedString(string s, ulong width, dchar fillChar = ' ')

@system @("leftJustifyFormattedString") unittest
{
import unit_threaded;

"test".red.to!string.leftJustifyFormattedString(10)
.to!string.should == "\033[31mtest\033[0m ";
}
@@ -559,8 +549,6 @@ auto rightJustifyFormattedString(string s, ulong width, char fillChar = ' ')

@system @("rightJustifyFormattedString") unittest
{
import unit_threaded;

"test".red.to!string.rightJustifyFormattedString(10).should == (" \033[31mtest\033[0m");
}

@@ -573,8 +561,6 @@ auto forceStyle(string text, Style style)

@("forceStyle") unittest
{
import unit_threaded;

auto splitt = "1es2eses3".split("es").filter!(not!(empty));
splitt.should == ["1", "2", "3"];
string s = "noformatting%snoformatting".format("red".red).forceStyle(Style.reverse);

0 comments on commit 6316447

Please sign in to comment.