Skip to content

Commit

Permalink
annotate unittests appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
Herringway committed Jul 11, 2018
1 parent a625c95 commit 7a5d714
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source/natcmp.d
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int compareNatural(T)(const T a, const T b) if (isSomeString!T) out(result) {
return -1;
return 0;
}
unittest {
@system pure unittest {
assert(compareNatural("10", "1") == 1, "1 > 10");
assert(compareNatural("010", "1") == 1, "1 > 010");
assert(compareNatural("10", "01") == 1, "01 > 10");
Expand Down Expand Up @@ -192,7 +192,7 @@ mixin template NaturalComparable(alias T) {
mixin NaturalComparableCommon!(compareNatural, T);
}
///
unittest {
@system pure unittest {
struct SomeStruct {
dstring someText;
mixin NaturalComparable!someText;
Expand All @@ -209,7 +209,7 @@ unittest {
assert(SomeStructWithFunction("100") > SomeStructWithFunction("2"));
assert(SomeStructWithFunction("100") == SomeStructWithFunction("100"));
}
unittest {
@system pure unittest {
struct SomeStruct {
dstring someText;
mixin NaturalComparable!someText;
Expand Down Expand Up @@ -242,7 +242,7 @@ bool compareNaturalSort(T)(const T a, const T b) if (isSomeString!T) {
return compareNatural(a,b) < 0;
}
///
unittest {
@system pure unittest {
import std.algorithm : sort, equal;
import std.array : array;
assert(compareNaturalSort("a", "b") == true);
Expand Down Expand Up @@ -275,7 +275,7 @@ int comparePathsNatural(T)(const T pathA, const T pathB) if (isSomeString!T) in
}
return outVal;
}
unittest {
@system pure unittest {
import std.path : buildPath;
assert(comparePathsNatural("a/b/c", "a/b/d") == -1, "Final path component sorting failed");
assert(comparePathsNatural("a/b/c", "a/b/d") == -1, "Final path component sorting failed");
Expand All @@ -297,7 +297,7 @@ mixin template NaturalPathComparable(alias T) {
mixin NaturalComparableCommon!(comparePathsNatural, T);
}
///
unittest {
@system pure unittest {
struct SomePathStruct {
dstring somePathText;
mixin NaturalPathComparable!somePathText;
Expand All @@ -321,7 +321,7 @@ bool comparePathsNaturalSort(T)(const T a, const T b) if (isSomeString!T) {
return comparePathsNatural(b,a) > 0;
}
///
unittest {
@system pure unittest {
import std.algorithm : sort, equal;
import std.array : array;
assert(comparePathsNaturalSort("a/b", "a1/b") == true);
Expand Down

0 comments on commit 7a5d714

Please sign in to comment.