Commit 427a433
Check the C++ integral tests by differentiating, not by string
IntTest1 and IntTest2 compared Integrate's printed form against the literals
"x2 / 2" and "x2 / 2 + 2x". Neither says what it looks like: "x2" parses as
a variable of that name, not as a square. And neither survives Integrate
gaining its constant of integration, which is why these two were the only
failures of the twenty-four once the bindings were built against the current
source instead of a 1.4.0-preview.2 package.
The printed form was never the property under test. Both now differentiate
the antiderivative and check the difference from the integrand simplifies to
zero, which is what the rest of the suite does and what AGENTS.md asks for.
That the form was the problem rather than the mathematics is visible in the
second case: d/dx of the antiderivative of x + 2 prints as 2 + x, so even a
corrected string would have been comparing arrangements rather than values.
Measured: d/dx(x ^ 2 / 2 + C) is x, d/dx(x ^ 2 / 2 + 2 * x + C) is 2 + x, and
both differences simplify to 0. cmake is not available here, so CTest on CI
is the check.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 5ba0843 commit 427a433
1 file changed
Lines changed: 16 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
57 | 71 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 72 | + | |
63 | 73 | | |
64 | 74 | | |
65 | 75 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
0 commit comments