Skip to content

Commit

Permalink
add special cases for .length and other comparisons with int types
Browse files Browse the repository at this point in the history
  • Loading branch information
gedaiu committed Apr 4, 2021
1 parent 4935d82 commit 0a8a2d1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/fluentasserts/core/lifecycle.d
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ static this() {
Registry.instance.register(Type.stringof, Type.stringof, "within", &between!Type);
}

/// special cases for .length and other comparisons with int types
static foreach(Type; BasicNumericTypes) {
Registry.instance.register(Type.stringof, "int", "lessOrEqualTo", &lessOrEqualTo!Type);
Registry.instance.register(Type.stringof, "int", "lessThan", &lessThan!Type);
Registry.instance.register(Type.stringof, "int", "greaterOrEqualTo", &greaterOrEqualTo!Type);
Registry.instance.register(Type.stringof, "int", "greaterThan", &greaterThan!Type);
}

///
static foreach(Type1; NumericTypes) {
Registry.instance.register(Type1.stringof ~ "[]", "void[]", "approximately", &approximatelyList);

Expand Down

0 comments on commit 0a8a2d1

Please sign in to comment.