Skip to content

Commit

Permalink
ADD addSign tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Jan 18, 2025
1 parent 847a3e5 commit 396793f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dn/M.hx
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ class M {


public static function addSign(v:Float) : String {
return v>0 ? "+"+v : Std.string(v);
return v>=0 ? "+"+v : Std.string(v);
}


Expand Down Expand Up @@ -1206,6 +1206,10 @@ class M {
CiAssert.equals( M.pretty(M.nullDefault(0.1, 5)), 0.1 );
CiAssert.equals( M.pretty(M.nullDefault(null, 5)), 5 );
CiAssert.equals( M.pretty(M.nullDefault(null, 5.1)), 5.1 );

CiAssert.equals( M.addSign(0), "+0" );
CiAssert.equals( M.addSign(-1), "-1" );
CiAssert.equals( M.addSign(2), "+2" );
}
#end
}

0 comments on commit 396793f

Please sign in to comment.