Repository: thrift Updated Branches: refs/heads/master 3aa617a48 -> dd89dce84
THRIFT-3456 rounding issue in static assert Client: D Patch: Nikolay Tolstokulakov This closes #726 Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/620e7a89 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/620e7a89 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/620e7a89 Branch: refs/heads/master Commit: 620e7a893a32867b664de4d8b648c8f1811d9f6f Parents: 3aa617a Author: Nikolay Tolstokulakov <[email protected]> Authored: Wed Dec 2 09:01:30 2015 +0600 Committer: Jens Geyer <[email protected]> Committed: Wed Dec 2 21:41:58 2015 +0100 ---------------------------------------------------------------------- lib/d/src/thrift/codegen/idlgen.d | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/620e7a89/lib/d/src/thrift/codegen/idlgen.d ---------------------------------------------------------------------- diff --git a/lib/d/src/thrift/codegen/idlgen.d b/lib/d/src/thrift/codegen/idlgen.d index 1cb4c1f..9f88936 100644 --- a/lib/d/src/thrift/codegen/idlgen.d +++ b/lib/d/src/thrift/codegen/idlgen.d @@ -551,7 +551,7 @@ version (unittest) { struct WithDefaults { string a = "asdf"; - double b = 1.0e+20; + double b = 3.1415; WithoutMeta c; mixin TStructHelpers!([ @@ -641,13 +641,16 @@ version (unittest) { } `); - static assert(structIdlString!WithDefaults == +import std.algorithm; + static assert(structIdlString!WithDefaults.startsWith( `struct WithDefaults { -1: string a = "asdf", - -2: double b = 1.0e+20, - 1: WithoutMeta c = {a: "foo", b: 3, }, + -2: double b = 3.141`)); + + static assert(structIdlString!WithDefaults.endsWith( +`1: WithoutMeta c = {a: "foo", b: 3, }, } -`); +`)); static assert(structIdlString!OneOfEach == `struct OneOfEach {
