Skip to content

Commit f90de88

Browse files
committed
UnitTestSuite.assertPositive/assertNegative: remove duplicate argument checks
1 parent e544ba7 commit f90de88

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

modules/DependencyControl/UnitTestSuite.moon

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,19 +453,17 @@ class UnitTest
453453
-- @tparam number actual the value
454454
-- @tparam[opt=false] boolean includeZero makes the assertion consider 0 to be positive
455455
assertPositive: (actual, includeZero = false) =>
456-
@checkArgTypes actual: {actual, "number"}
457-
res = includeZero and actual >= 0 or actual > 0
458456
@checkArgTypes actual: {actual, "number"}, includeZero: {includeZero, "boolean"}
457+
res = includeZero and actual >= 0 or actual > 0
459458
@assert res, @@msgs.assert.positiveNegative, "positive",
460459
includeZero and "included" or "excluded"
461460

462461
--- Fails the assertion if a specified number is greater than or equal 0.
463462
-- @tparam number actual the value
464463
-- @tparam[opt=false] boolean includeZero makes the assertion not fail when a 0 is encountered
465464
assertNegative: (actual, includeZero = false) =>
466-
@checkArgTypes actual: {actual, "number"}
467-
res = includeZero and actual <= 0 or actual < 0
468465
@checkArgTypes actual: {actual, "number"}, includeZero: {includeZero, "boolean"}
466+
res = includeZero and actual <= 0 or actual < 0
469467
@assert res, @@msgs.assert.positiveNegative, "positive",
470468
includeZero and "included" or "excluded"
471469

0 commit comments

Comments
 (0)