You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2014/10/09 21:19:29 UTC
git commit: THRIFT-2775 static assert fails in
src/thrift/internal/ctfe.d Client: D Patch: Konrad Grochowski
Repository: thrift
Updated Branches:
refs/heads/master ec71f2ebc -> 62d2af7cd
THRIFT-2775 static assert fails in src/thrift/internal/ctfe.d
Client: D
Patch: Konrad Grochowski
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/62d2af7c
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/62d2af7c
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/62d2af7c
Branch: refs/heads/master
Commit: 62d2af7cd3a72ab6f861670503bb16c946d9ca8e
Parents: ec71f2e
Author: Jens Geyer <je...@apache.org>
Authored: Thu Oct 9 20:56:44 2014 +0200
Committer: Jens Geyer <je...@apache.org>
Committed: Thu Oct 9 20:56:44 2014 +0200
----------------------------------------------------------------------
lib/d/src/thrift/internal/ctfe.d | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/62d2af7c/lib/d/src/thrift/internal/ctfe.d
----------------------------------------------------------------------
diff --git a/lib/d/src/thrift/internal/ctfe.d b/lib/d/src/thrift/internal/ctfe.d
index 3b10a78..974db01 100644
--- a/lib/d/src/thrift/internal/ctfe.d
+++ b/lib/d/src/thrift/internal/ctfe.d
@@ -86,11 +86,13 @@ string ctfeToString(T)(T val) if (isFloatingPoint!T) {
}
unittest {
+ import std.algorithm;
static assert(ctfeToString(double.infinity) == "inf");
static assert(ctfeToString(-double.infinity) == "-inf");
static assert(ctfeToString(double.nan) == "nan");
static assert(ctfeToString(0.0) == "0");
static assert(ctfeToString(-0.0) == "-0");
- static assert(ctfeToString(3.1415) == "3.1415");
+ static assert(ctfeToString(2.5) == "2.5");
+ static assert(ctfeToString(3.1415).startsWith("3.141"));
static assert(ctfeToString(2e-200) == "2e-200");
}