-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make mathematica_test a little less brittle #2829
Make mathematica_test a little less brittle #2829
Conversation
@@ -85,10 +85,10 @@ struct TupleHelper<0, Tuple, OptionalExpressIn> : not_constructible { | |||
|
|||
template<typename V, typename A, int d, | |||
template<typename, typename, int> class E, | |||
typename OptionalExpressIn> | |||
typename OptionalExpressIn = std::nullopt_t> | |||
std::string ToMathematicaExpression( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is extremely suspicious that a function declared in the internal namespace in the body file would be used in tests. The tests should only depend on the public API. As a matter of fact I am not even sure how this compiles.
One solution would be to officially move this function (and its siblings) to the public API, probably with a better name. That also ties with the forward declarations, see comment below.
mathematica/mathematica_test.cpp
Outdated
"SetPrecision[+2.00000000000000000*^+00,$MachinePrecision]," | ||
"SetPrecision[+3.00000000000000000*^+00,$MachinePrecision]]", | ||
ToMathematica(std::vector<double>{2, 3})); | ||
EXPECT_EQ("List[" + ToMathematica(2.0) + "," + ToMathematica(3.0) + "]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to preserve a formatting closer to the original one: (1) line break after [
(2) line break after ,
(3) line break after the (replacement for) the SetPrecision
call, i.e., after the +
(unless followed by a comma). The clang-format
formatting makes it hard to visually parse the structure.
retest this please |
No description provided.