Skip to content

Commit

Permalink
tests: add test for nested integral in exponent
Browse files Browse the repository at this point in the history
Adding this test catches the previous regression in removing doit()
  • Loading branch information
mgreminger committed Nov 2, 2024
1 parent 8125cd9 commit 030234b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_calc.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -425,3 +425,20 @@ test('Test derivative dimensional analysis bug', async () => {
expect(content).toBe('');
});

test('Test unitless nested integral in exponent', async () => {
await page.setLatex(0, String.raw`2^{\int_{-\frac{h}{2}}^{\frac{h}{2}}\left(\int_{-\frac{w}{2}}^{\frac{w}{2}}\left(y^2\right)\mathrm{d}\left(x\right)\right)\mathrm{d}\left(y\right)}=`);

await page.locator('#add-math-cell').click();
await page.setLatex(1, 'h=2');

await page.locator('#add-math-cell').click();
await page.setLatex(2, 'w=3');

await page.waitForSelector('.status-footer', {state: 'detached'});

let content = await page.textContent('#result-value-0');
expect(parseLatexFloat(content)).toBeCloseTo(4, precision);
content = await page.textContent('#result-units-0');
expect(content).toBe('');
});

0 comments on commit 030234b

Please sign in to comment.